> 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/use-case-diagram.md).

# Use Case Diagram

## About

A Use Case Diagram represents high-level system functionality and the interactions between actors (users or systems) and use cases (functionalities). It helps in understanding user requirements and system scope.

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

### **Key Elements**

1. **Actors**&#x20;
   * External entities (users, systems) that interact with the system.
   * Represented as stick figures.
2. **Use Cases**&#x20;
   * System functionalities represented as **ovals**.
   * Describes what the system does, **not how**.
3. **Relationships**&#x20;
   * **Association** (solid line) – Connects actors and use cases.
   * **Include** (`<<include>>`) – Reusable functionality between use cases.
   * **Extend** (`<<extend>>`) – Optional or conditional behavior.
4. **System Boundary**&#x20;
   * A rectangle that encloses all use cases within a system.

## 1. Online Shopping System

This diagram represents an **Online Shopping System** with different actors and use cases.

{% hint style="success" %}

* **Actors (`actor`)**: Represent `Customer` and `Admin`.
* **Use Cases (`(UseCase)`)**: Define system functionalities.
* **Relationships:**
  * **Direct association (`-->`)**
  * **Include (`-->`)**: `Place Order` includes `Make Payment`.
  * **Extend (`-->`)**: `Apply Discount` is optional.
    {% endhint %}

```plant-uml
@startuml
title Online Shopping System - Use Case Diagram

actor Customer
actor Admin

rectangle "Online Shopping System" {
    Customer --> (Browse Items)
    Customer --> (Add to Cart)
    Customer --> (Place Order)
    (Place Order) --> (Make Payment) : includes
    (Place Order) --> (Apply Discount) : extends
    (Make Payment) --> (Send Payment Confirmation)

    Admin --> (Manage Products)
    Admin --> (View Reports)
}

@enduml
```

<figure><img src="https://3632859567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPd6ktrA5pPLsZJktj2fm%2Fuploads%2FVapyG6TS34wSXmFsLkOO%2Fplantuml-use-case-diagram-1.png?alt=media&amp;token=4166f4a9-1533-4def-ad49-323da65b1789" alt=""><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/use-case-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.
