Overview
In the"An object diagram is a graph of instances, including objects and data values. A static object diagram is an instance of a class diagram; it shows a snapshot of the detailed state of a system at a point in time. The use of object diagrams is fairly limited, namely to show examples of data structure."The latest UML 2.5.1 specification does not explicitly define object diagrams, but provides a notation for "instances" of classifiers. Object diagrams and class diagrams are closely related and use almost identical notation. Both diagrams are meant to visualize static structure of a system. While class diagrams show classes, object diagrams display instances of classes ( objects).Bianca Scholten (2007) ''The Road to Integration: A Guide to Applying the ISA-95 Standard in Manufacturing''. p.155 Object diagrams are more concrete than class diagrams. They are often used to provide examples or act as test cases for class diagrams. Only aspects of current interest in a model are typically shown on an object diagram.
Object diagram topics
Instance specifications
Each object and link on an object diagram is represented by an ''InstanceSpecification''. This can show an object's classifier (e.g. an abstract or concreteObject diagram example
Consider one possible way of modeling production of the Fibonacci sequence. In the first UML object diagram on the right, the instance in the leftmost instance specification is named ''v1'', has ''IndependentVariable'' as its classifier, plays the ''NMinus2'' role within the ''FibonacciSystem'', and has a slot for the ''val'' attribute with a value of ''0''. The second object is named ''v2'', is of class ''IndependentVariable'', plays the ''NMinus1'' role, and has ''val = 1''. The ''DependentVariable'' object is named ''v3'', and plays the ''N'' role. The topmost instance, an anonymous instance specification, has ''FibonacciFunction'' as its classifier, and may have an instance name, a role, and slots, but these are not shown here. The diagram also includes three named links, shown as lines. Links are instances of an association. In the second diagram, at a slightly later point in time, the ''IndependentVariable'' and ''DependentVariable'' objects are the same, but the slots for the ''val'' attribute have different values. The role names are not shown here. In the last object diagram, a still later snapshot, the same three objects are involved. Their slots have different values. The instance and role names are not shown here.Usage
If you are using a UML modeling tool, you will typically draw object diagrams using some other diagram type, such as on a class diagram. An object instance may be called an ''instance specification'' or just an ''instance''. A link between instances is generally referred to as a ''link''. Other UML entities, such as an aggregation or composition symbol (a diamond) may also appear on an object diagram.References
External links