---
title: "Video rental shop class diagram"
subject: "Object Oriented Analysis and Design"
chapter: 2
key: "semester_6/object_oriented_analysis_and_design:video-rental-class-diagram"
source: https://www.bctengineer.com/q/semester_6/object_oriented_analysis_and_design/video-rental-class-diagram
site: BCT Engineering
---

# Video rental shop class diagram

Object Oriented Analysis and Design · Chapter 2: Object Oriented Analysis

- Asked in: 2069 Bhadra, 12 marks
- Video: [How to draw Class Diagram?](https://www.youtube.com/watch?v=-UTEeuu6gvI) — MADE_EASY_FOR_YOU
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_6/object_oriented_analysis_and_design/video-rental-class-diagram
- Whole chapter: https://www.bctengineer.com/md/semester_6/object_oriented_analysis_and_design/chapter-2

## Question

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.

## 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().

## Answer

**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

```text
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
- `Partner` generalizes `Importer` and `ChainTrade`; a `Partner` has many `Agreement`s; each `Agreement` covers one or more `Video`s.
- `Video` is generalized into `ActionVideo`, `ArtVideo`, `ChildrenVideo`. Since a video may be a blend of action and art, the generalization is marked **{overlapping}**.
- `Customer` is generalized into `RandomCustomer`, `RegularCustomer`, `ClubMember` ({disjoint}).
- `Customer` 1 to many `Rental`; `Rental` many to 1..* `Video`.
- Rental price is derived: `calcRentalPrice() = f(rentalPeriod, purchasePrice, customer type)` (the customer relationship gives the discount).

## Check yourself

The answer's key points as multiple-choice questions, with the correct option and why.

1. How is the blend of action and art videos modelled?
   A. Video generalization marked {overlapping}
   B. Disjoint generalization
   C. Aggregation
   D. A separate unrelated class
   Answer: A. {overlapping} allows a video to be both ActionVideo and ArtVideo. (Key point: Overlapping generalization)

2. How are random, regular and club-member customers modelled?
   A. Customer generalized into RandomCustomer, RegularCustomer and ClubMember ({disjoint}), with name in Customer
   B. Three unrelated classes
   C. Rental generalized into customers
   D. Customer has a part Video
   Answer: A. Shared name is in the superclass; cumulative rentals and member address in subclasses. (Key point: Customer hierarchy)

3. Where are date, copies, lease time and purchase price recorded?
   A. In the Agreement class between Partner (importer or chain trade) and Video
   B. In Customer
   C. In Rental
   D. In ArtVideo
   Answer: A. Each acquisition agreement links a Partner to one or more Videos. (Key point: Agreement placement)

4. How is the rental price derived?
   A. From the rental period, purchase price and customer relationship
   B. From the video name only
   C. Fixed for all videos
   D. From the importer's bank details
   Answer: A. Rental relates a Customer (1 to many) to Videos, and customer type gives the discount. (Key point: Rental and price)

## Related in Object Oriented Analysis and Design

- [Event management system summary and class diagram](https://www.bctengineer.com/question.md?key=semester_6%2Fobject_oriented_analysis_and_design%3Aoems-executive-summary-class-diagram) — Object Oriented Analysis and Design, chapter 2
- [XYZ Marina class diagram](https://www.bctengineer.com/question.md?key=semester_6%2Fobject_oriented_analysis_and_design%3Amarina-class-diagram) — Object Oriented Analysis and Design, chapter 2
- [Rental car system candidate objects](https://www.bctengineer.com/question.md?key=semester_6%2Fobject_oriented_analysis_and_design%3Arental-car-system-candidate-objects) — Object Oriented Analysis and Design, chapter 2
- [Health care center class diagram to code](https://www.bctengineer.com/question.md?key=semester_6%2Fobject_oriented_analysis_and_design%3Ahealth-care-class-diagram-code) — Object Oriented Analysis and Design, chapter 4
- [Point of sale class diagram](https://www.bctengineer.com/question.md?key=semester_6%2Fobject_oriented_analysis_and_design%3Apos-class-diagram-multiplicity) — Object Oriented Analysis and Design, chapter 2
- [Deployment diagram as class diagram of nodes](https://www.bctengineer.com/question.md?key=semester_6%2Fobject_oriented_analysis_and_design%3Adeployment-diagram-special-class-diagram) — Object Oriented Analysis and Design, chapter 3

## Related in other subjects

- [Linear chain polymer; sulphur-based inorganic polymers](https://www.bctengineer.com/question.md?key=semester_2%2Fengineering_chemistry%3Alinear-polymer-sulphur-inorganic) — Engineering Chemistry, chapter 4
- [CRM plan for online shop](https://www.bctengineer.com/question.md?key=semester_8%2Finformation_system%3Acrm-online-shop-plan) — Information System, chapter 3
- [Microprocessor based system and bus organization](https://www.bctengineer.com/question.md?key=semester_4%2Fmicroprocessor%3Amp-based-system-bus-organization) — Microprocessor, chapter 1, asked 5×
- [Date of birth validation with exceptions](https://www.bctengineer.com/question.md?key=semester_3%2Fobject_oriented_programming%3Adob-exception-program) — Object Oriented Programming, chapter 10
