Object Diagram

Return to Introduction  Previous page  Next page

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.

Object--Classifiers

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.

ObjectDiagram

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.

Object Diagram Elements

Object Diagram Connectors

e_Actor

c_InformationFlow

e_Object

c_Associate

e_Collaboration

c_Dependency

e_informationItem

 

e_Boundary

 

e_Control

 

e_entity3

 

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."