An Object diagram is closely related to a Class diagram, with the distinction that it depicts object instances of Classes at a point in time. This might appear similar to a Composite Structure diagram, which also models run-time behavior; the difference is that Object diagrams exemplify the static Class diagrams, whereas Composite Structure diagrams reflect run-time architectures different from their static counterparts. Object diagrams do not reveal architectures varying from their corresponding Class diagrams, but reflect multiplicity and the roles instantiated Classes could serve. They are useful in understanding a complex Class diagram, by creating different cases in which the relationships and Classes are applied. An Object diagram can also be a kind of Communication diagram, which also models the connections between objects, but additionally sequences events along each path.
Note: Communication diagrams were known as Collaboration diagrams in UML 1.4.
Example Diagram
The following example first shows a simple Class diagram, with two Class elements connected.
The Classes above are instantiated below as Objects in an Object diagram. There are two instances of Computer in this model, which can prove useful for considering the relationships and interactions Classes play in practice, as Objects.
Toolbox Elements and Connectors
Select Object diagram elements and connectors from the Object pages of the Enterprise Architect UML Toolbox.
Tip: Click on the elements and connectors below for more information.
OMG UML Specification
The OMG UML specification (UML Superstructure Specification, v2.0, p. 12) states:
"A diagram that encompasses objects and their relationships at a point in time. An object diagram may be considered a special case of a class diagram or a communication diagram."