Object Diagrams

An object diagram is a UML diagram that provides a graphical view of the structure of a system through concrete instances of classes (objects), associations (instance links), and dependencies.

Note: To create an object diagram in an existing OOM, right-click the model in the Browser and select New > Object Diagram. To create a new model, select File > New Model, choose Object Oriented Model as the model type and Object Diagram as the first diagram, and then click OK.

As a diagram of instances, the object diagram shows an example of data structures with data values that corresponds to a detailed situation of the system at a particular point in time.

The object diagram can be used for analysis purposes: constraints between classes that are not classically represented in a class diagram can typically be represented in an object diagram.

If you are a novice in object modeling, instances usually have more meaning than classifiers do, because classifiers represent a level of abstraction. Gathering several instances under the same classifier helps you to understand what classifiers are. Moreover, even for analysts used to abstraction, the object diagram can help understand some structural constraints that cannot be easily graphically specified in a class diagram.

In this respect, the object diagram is a limited use of a class diagram. In the following example, the class diagram specifies that a class Writer is linked to a class Document.

The object diagram, deduced from this class diagram, highlights some of the following details: the object named John, instance of the class Writer is linked to two different objects Draft and Master that are both instances of the class Document.



Note: You can drag classes and associations from the Browser and drop them into an object diagram. If you drag classes, new objects as instances of classes are created. If you drag an association, a new instance link as instance of the association, and two objects are created.