> For the complete documentation index, see [llms.txt](https://www.pranaypourkar.co.in/the-programmers-guide/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.pranaypourkar.co.in/the-programmers-guide/system-design/system-design-methodology/diagrams/uml-diagrams/plantuml/object-diagram.md).

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

{% hint style="success" %}
Refer to the official documentation for more details - <https://plantuml.com/object-diagram>
{% endhint %}

### **Key Elements**

1. **Objects (Instances)**&#x20;
   * Represented as rectangles with an **underlined name** (e.g., `order1: Order`).
   * Shows real-time values of attributes.
2. **Links (Associations)**&#x20;
   * Lines connecting objects to represent **relationships**.
   * These are actual **instance-level** associations, unlike general class associations.
3. **Attributes & Values**&#x20;
   * Shows **specific values** of attributes at runtime (e.g., `status = "Processing"`).
4. **Multiplicity & Relationships**&#x20;
   * Displays **one-to-one, one-to-many, or many-to-many** relationships.
5. **Aggregation & Composition**&#x20;
   * Can illustrate **part-whole relationships** between objects.

## 1. E-commerce system

This represents the **state of objects at runtime** in an e-commerce system.

{% hint style="success" %}

* **Objects (`object ObjectName { }`)**.
* **Relationships (`--`)**: Shows how objects are related at runtime.
  {% endhint %}

```plant-uml
@startuml
title E-Commerce Order - Object Diagram

object Customer {
    name = "John Doe"
    email = "john@example.com"
}

object Order {
    orderId = 12345
    totalAmount = 150.00
}

object Product {
    name = "Laptop"
    price = 1500.00
}

Customer -- Order : places
Order -- Product : contains

@enduml
```

<figure><img src="https://3632859567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPd6ktrA5pPLsZJktj2fm%2Fuploads%2FSnpsZXd0cZcSAFy8xTMU%2Fplantuml-object-diagram-1.png?alt=media&amp;token=2c5dbde7-cf48-46af-a1f2-02a16a872d59" alt="" width="246"><figcaption></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://www.pranaypourkar.co.in/the-programmers-guide/system-design/system-design-methodology/diagrams/uml-diagrams/plantuml/object-diagram.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
