OOPortal OOPortal


Object Diagrams  «Prev  Next»
Lesson 3Object diagram notation
ObjectiveCompare and contrast the object diagram and the class diagram notation.

Object Diagram Notation

The object diagram notation is largely a subset of the class diagram notation. The graphics below show examples of an object and a class for the object.
Class diagram
Class diagram

Object diagram
Object diagram

Note the differences between the two diagrams:

Class diagram Object diagram
The class has three compartments: name, attribute, and operation. The object has only two compartments: name and attribute.
The class name stands alone in the class name compartment. The format for an object name is object name, colon, class name (Tom : Employee). You will encounter this notation in other diagrams that model objects rather than classes.
Sometimes the object name is left off and only the colon and class name are used. This is referred to as an anonymous object.
The class attribute compartment defines the properties of the attributes. The object defines only the current value of each attribute.
Operations are listed in the class. Operations are not included in the object because they would be identical for every object of the same class.
The classes are connected with an association with a name and multiplicity. The objects are connected with a link that has a name and no multiplicity. Classes represent a "classification" of objects, so it is necessary to specify how many mayparticipate in the association. Objects represent single entities. All links are one to one, so multiplicity is irrelevant. Roles may be used on links and associations.

In the next lesson, you will learn how to use the object diagram for testing and verification.

Object Diagram Notation versus class Diagram Notation - Quiz

Click the Quiz link below to take a short quiz about the material we've just covered.
Object Diagram Notation versus class Diagram Notation - Quiz