Object Diagram
About
An Object Diagram in UML represents a snapshot of instances (objects) and their relationships at a particular moment in time. It is a real-world instantiation of a Class Diagram, showing actual values instead of abstract structures. Object Diagrams help in visualizing runtime scenarios of a system, such as debugging, testing, or understanding object interactions.
Refer to the official documentation for more details - https://plantuml.com/object-diagram
Key Elements
Objects (Instances)
Represented as rectangles with an underlined name (e.g.,
order1: Order
).Shows real-time values of attributes.
Links (Associations)
Lines connecting objects to represent relationships.
These are actual instance-level associations, unlike general class associations.
Attributes & Values
Shows specific values of attributes at runtime (e.g.,
status = "Processing"
).
Multiplicity & Relationships
Displays one-to-one, one-to-many, or many-to-many relationships.
Aggregation & Composition
Can illustrate part-whole relationships between objects.
1. E-commerce system
This represents the state of objects at runtime in an e-commerce system.
Objects (
object ObjectName { }
).Relationships (
--
): Shows how objects are related at runtime.
@startuml
title E-Commerce Order - Object Diagram
object Customer {
name = "John Doe"
email = "[email protected]"
}
object Order {
orderId = 12345
totalAmount = 150.00
}
object Product {
name = "Laptop"
price = 1500.00
}
Customer -- Order : places
Order -- Product : contains
@enduml

Last updated
Was this helpful?