Use case diagrams: actors and use cases

Use case diagrams: actors and use cases

puml.online

简介 / Introduction

Use case diagrams model system functional requirements, centering on actors and use cases, with system boundaries and relationships to express business scenarios. This article compares PlantUML and Mermaid syntax for use case diagrams.

PlantUML 版

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
@startuml
left to right direction

actor "Customer" as Customer
actor "Cashier" as Cashier
actor "System" as System

rectangle "Online Ordering System" {
Customer -->> (Place Order)
Customer -->> (Cancel Order)
Cashier -->> (Process Refund)
(Place Order) .> (Generate Order) : include
(Place Order) .> (Send Notification) : include
(Cancel Order) .> (Send Notification) : include
}
@enduml

Mermaid 版

1
2
3
4
5
6
7
8
9
flowchart LR
subgraph "Online Ordering System"
A1(("Customer")) --Place Order--> B1["Place Order"]
A1(("Customer")) --Cancel Order--> B2["Cancel Order"]
A2(("Cashier")) --Process Refund--> B3["Process Refund"]
B1 -->|include| B4["Generate Order"]
B1 -->|include| B5["Send Notification"]
B2 -->|include| B5
end

对比 / Side-by-side

Element PlantUML Mermaid
Actor declaration actor "Name" as Alias A(("Name")) node
System boundary rectangle "Name" { ... } subgraph "Name" ... end
Association Actor -- (Use Case) A -- B (node-to-node link)
include (Use Case) .> (Sub) : include `B –>
Direction control left to right direction flowchart LR

小结 / Wrap-up

PlantUML use case diagrams have richer semantics, supporting include/extend relationships and explicit rectangle system boundaries; Mermaid simulates use cases with a flowchart, excelling in lightweight scenarios and seamless integration with state diagrams. Both export to SVG for documentation. For projects with many actors and complex business logic, PlantUML is recommended; for quick demos or inline Markdown, Mermaid is more convenient.

  • Title: Use case diagrams: actors and use cases
  • Author: puml.online
  • Created at : 2026-10-19 09:00:00
  • Updated at : 2026-10-19 01:07:19
  • Link: https://puml.online/blog/use-case-diagram-actors-en/
  • License: This work is licensed under CC BY-NC-SA 4.0.
On this page
Use case diagrams: actors and use cases