In: Computer Science
There are two types of rental items in the VideoSystem: DVDs and video cassettes (“videos”). Customers rent either of these two types of rental items. A rental item has a barcode and a movie name. The status of a rental item is either rented, available, expired. If it's rented, a rental item due date specifies the date that the item should be returned. You can ask for the status of a rental item. All rental items can be rented (by a customer) and returned. When an item is returned, the clerk who handles the transaction labels it “OK” or "damaged" depending on its status. Customers can be retrieved by their id, rental items by their barcode. Draw a class diagram that represents the information handled by the video system. You can use paper to draw and then upload it to the system. Your class diagram should simply reflect the relationships described above. Make appropriate use of UML class diagram features: relationship (association, generalization, aggregation, multiplicity, etc,), and attributes (including type). You do not need to specify the operations. The only diagram created using the software would be evaluated. Hand made diagrams would not be considered.
Please find below the steps to create Class Diagram for the given VideoSystem:
Step 1: List classes and subclasses:
1. RentalItem: This class has below two subclasses based on its Type:
2. Customer: The class which holds the customer details
3. Clerk: The class which holds the clerk details that set the status of a rented item when it is returned
Step 2: Assign data members to the classes:
1. RentalItem(barcode, name)
2. Rented(return_date, return_status)
3. Customer(customerID)
Step 3: The relationships and associations:
1. RentalItem has inheritance/generalization relationship with below sub classes based on type :
1.1 DVD
1.2 Video
This has further three sub classes based on its status:
1.1 Rented
1.2 Available
1.3 Expired
2. Customer is associated with RentalItem and takes none or many Items on rent. An item is also taken by none or many customers. This is a M: N relationship.
3. Clerk sets the status of Rented items and a rental item has none or many status updates by a clerk. It is again a M:N relationship.
Step 4: Final Class Diagram:
**Attributes are not given for all classes, the given attributes in description are mentioned in appropriate classes:
Step 5: Notations:
Inheritance/Genralization:
Association:
**Kindly comment if need any assistance. Thanks!