Object Diagram
An object diagram is a graphical representation that showcases objects and their relationships at a specific moment in time. It provides a snapshot of the system's structure, capturing the static view of the instances present and their associations. PlantUML offers a simple and intuitive way to create object diagrams using plain text. Its user-friendly syntax allows for quick diagram creation without the need for complex GUI tools. Moreover, the PlantUML forum provides a platform for users to discuss, share, and seek assistance, fostering a collaborative community. By choosing PlantUML, users benefit from both the efficiency of markdown-based diagramming and the support of an active community.
Definition of objects
You define instances of objects using the object
keyword.
|
🎉 Copied!
|
|
Relations between objects
Relations between objects are defined using the following symbols :
| Type | Symbol | Purpose |
| Extension |
<|--
|
Specialization of a class in a hierarchy |
| Implementation |
<|..
|
Realization of an interface by a class |
| Composition |
*--
|
The part cannot exist without the whole |
| Aggregation |
o--
|
The part can exist independently of the whole |
| Dependency |
-->
|
The object uses another object |
| Dependency |
..>
|
A weaker form of dependency |
-- by .. to have a dotted line.
Knowing those rules, it is possible to draw the following drawings.
It is possible a add a label on the relation, using : followed by the text of the label.
For cardinality, you can use double-quotes "" on
each side of the relation.
|
🎉 Copied!
|
|
Associations objects
|
🎉 Copied!
|
|
Adding fields
To declare fields, you can use the symbol : followed by
the field's name.
|
🎉 Copied!
|
|
And you can mix objet's fields definition:
|
🎉 Copied!
|
|
It is also possible to group all fields between brackets
{}.
|
🎉 Copied!
|
|
Common features with class diagrams
Map table or associative array
You can define a map table or associative array, with map keyword and => separator.
|
🎉 Copied!
|
|
|
🎉 Copied!
|
|
|
🎉 Copied!
|
|
And add link with object.
|
🎉 Copied!
|
|
|
🎉 Copied!
|
|
[Ref. #307]
|
🎉 Copied!
|
|
[Ref. QA-12934]
|
🎉 Copied!
|
|
[Ref. #307]
Program (or project) evaluation and review technique (PERT) with map
You can use map table in order to make Program (or project) evaluation and review technique (PERT) diagram.
|
🎉 Copied!
|
|
[Ref. QA-12337]
Display JSON Data on Class or Object diagram
Simple example
|
🎉 Copied!
|
|
[Ref. QA-15481] For another example, see on JSON page.