Homework 8: Class Diagrams

Due date: Tuesday, November 8

Note: all diagrams must be drawn with a UML tool.

1 Interpreting Class Diagrams (30 points)
The following is another analysis class diagram of the video store application from lecture. Compare it to the video store class diagram from the lecture (last version). Note that not much information about the model is given; use common sense to figure out what this diagram means.
a) What is the purpose of the class Store? Is it a good idea to have this class?
b) The class RentalContract has been replaced by VideoRental. What are the advantages and disadvantages of each solution; which one is better?
c) The class VideoCopy has been added. What would be the purpose of this class?
d) The class VideoCatalog has been added. What are the advantages and disadvantages of having this class?
e) The class RentalHistory has been added. What might be the purpose of this class? What are the advantages and disadvantages of having this class?
f) Identify 3 things that you would like to change about this analysis model (do not include things that exist in the model presented in lecture, or that you discussed above). For each, explain what the change is, and why you believe that it is a good idea. Each change should involve the addition or removal of a class, and all consequences of this addition or removal, such as added or removed associations.

2 Object Diagram (10)
Draw an object diagram that represents part of the video store from the slides. The diagram must have at least 12 objects of at least 4 classes. Include attributes and class names.

3 Class Diagram (30)
Draw an analysis class diagram of a simple online bookstore — a Web site where one can buy books. Have at least 12 classes; each class should have attributes and some should have operations. Include multiplicities. Name your classes so that their purpose is clear; if that is not possible, give a brief description of the class. Lay out the diagram in a readable way.

4 Reverse engineering a class diagram (30)
The Java 2D Graph Package is an open-source library for drawing function graphs. Create a class diagram that accurately represents class Graph2D, including its attributes, its operations, and associations and generalizations that it participates in. Include all classes that are directly related to Graph2D, but you do not need to include their attributes and operations. Use correct multiplicities and role names for all associations.


CS 497 Fall 2005