> 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="/files/7StAjPHiFPZVprZXYG2m" 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
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=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
