Diagramming



Classes, Objects, and Relations

Classes are diagrammed as rectangles with square corners. The name of the class is written immediately above the rectangle.
Objects are usually diagrammed as rectangles with rounded corners. The name of the class to which is belongs is written on the inside of the rectangle at the top. The name of the actual object itself is written immediately above the rectangle.
Objects can also be diagrammed so that the name of the actual object itself is written by a box with an arrow that points towards to the rectangle.
The instanceof relation between a class and an object is drawn as a dotted line between the class and the object that is an instance of that class.
The has a relation between objects is drawn with a pointing arrow from a box inside an object to the object that is has in it.
The is a inheritance relation between two classes is drawn as a skinny hollow arrow from the child class to its parent class




Diagramming Members in an Object*



*Please note that if we were diagramming instance members in a class rectangle, then they would be dotted, and none of the instance data members would have values.



Eliminating Redundancies in Inheritance Diagrams

Remember that when displaying members in inheritance diagrams, it is not necessary to include all the members of the parent class in the child class. This is redundant and wasteful.