- 2069 Bhadra · 12 marks
Video rental shop class diagram
Short answer
The class diagram includes Partner (Importer, ChainTrade) linked to Agreement (date, copies, leaseTime, price) which links to Video (name, id, rentalPrice). Video generalizes to ActionVideo (violenceDegree), ArtVideo (awards), ChildrenVideo (ageLimit) with overlapping between Action and Art. Customer generalizes to RandomCustomer, RegularCustomer (cumulativeRentals), ClubMember (memberAddress, advertise). Rental links Customer and Video with rentalPeriod and calcPrice().
The Premier Video Rental Shop (PVRS) decides to implement a database-based information system. PVRS acquires the video from the importer or chain trade. An agreement will be signed with both partners and it defines the date, number of copies, time frame of the lease and purchase price. As an additional info of importer also the address and bank details will be recorded. The customer rents a video from the PVRS. From each video the name, ID and rental price information will be recorded. The rental price is calculated from the rental period, the purchase price and the customer relationship. Video types include action, art and children's video. Video may also be a blend of action and art videos. As an action video info the degree of violence will be recorded, and from art videos the awards and from children's videos the age limit. The customer relationship can be a random customer, regular or member of PVRS club. As an overarching customer info the name will be recorded and from regular customer the cumulative sum of the number of rental events. From the members of PVRS club information, the member address is used in order to advertise new products and offers. Draw a class diagram, which presents the main classes, properties, methods, and relationships between classes.
Assumptions: PVRS is the shop; an Agreement is made for each acquisition from a Partner (importer or chain trade); a Rental links a customer with videos.
Classes, attributes and methods
| Class | Attributes | Methods |
|---|---|---|
| Partner (abstract) | name | - |
| Importer | address, bankDetails | - |
| ChainTrade | - | - |
| Agreement | date, copies, leaseTime, purchasePrice | sign() |
| Video (abstract) | name, id, rentalPrice | calcRentalPrice() |
| ActionVideo | violenceDegree | - |
| ArtVideo | awards | - |
| ChildrenVideo | ageLimit | - |
| Customer (abstract) | name | - |
| RandomCustomer | - | - |
| RegularCustomer | cumulativeRentals | - |
| ClubMember | memberAddress | advertise() |
| Rental | rentalPeriod, date | calcPrice() |
Class diagram
Partner (importer or chain trade)
+----------+ 1 * +-----------+ * 1..* +--------+
| Partner |-------| Agreement |----------| Video |
|----------| |-----------| |--------|
| name | | date | | name |
+----------+ | copies | | id |
^ ^ | leaseTime | | rental |
| | | price | | Price |
Importer Chain +-----------+ +--------+
-address Trade ^ ^ ^
-bank Action Art Children
-viol. -awards -ageLimit
{overlapping: Action, Art}
+----------+ 1 * +--------+ * 1..* +--------+
| Customer |-------| Rental |----------| Video |
|----------| |--------| +--------+
| name | | period |
+----------+ | price()|
^ ^ ^ +--------+
Random Regular ClubMember
-total -address
Rentals +advertise()
Relationships
PartnergeneralizesImporterandChainTrade; aPartnerhas manyAgreements; eachAgreementcovers one or moreVideos.Videois generalized intoActionVideo,ArtVideo,ChildrenVideo. Since a video may be a blend of action and art, the generalization is marked {overlapping}.Customeris generalized intoRandomCustomer,RegularCustomer,ClubMember({disjoint}).Customer1 to manyRental;Rentalmany to 1..*Video.- Rental price is derived:
calcRentalPrice() = f(rentalPeriod, purchasePrice, customer type)(the customer relationship gives the discount).
✓ Answer checked by Claude Opus 5.5 (high effort)
Related questions
- Event management system summary and class diagram · Object Oriented Analysis and Design, chapter 2
- XYZ Marina class diagram · Object Oriented Analysis and Design, chapter 2
- Rental car system candidate objects · Object Oriented Analysis and Design, chapter 2
- Health care center class diagram to code · Object Oriented Analysis and Design, chapter 4
- Point of sale class diagram · Object Oriented Analysis and Design, chapter 2
- Deployment diagram as class diagram of nodes · Object Oriented Analysis and Design, chapter 3
- Linear chain polymer; sulphur-based inorganic polymers · Engineering Chemistry, chapter 4
- CRM plan for online shop · Information System, chapter 3
- Microprocessor based system and bus organization · Microprocessor, chapter 1 · asked 5×
- Date of birth validation with exceptions · Object Oriented Programming, chapter 10
All Object Oriented Analysis and Design chapter 2 questions →