Use case diagrams: where to draw the system boundary
简介 / Introduction
When drawing a use case diagram, the tricky part is rarely the connections — it is where the boundary sits. The boundary decides which use cases belong to the system you are building and which belong to external systems (an external system is drawn as an “actor” in your diagram). Draw it too wide and the requirements leak out; draw it too narrow and use cases land in the wrong system.
This post uses an order system: “browse products” and “place order” live inside the boundary, while “payment” and “shipping” are delegated to external systems, with <<include>> / <<extend>> relations expressing how the use cases collaborate. PlantUML draws the boundary with rectangle; Mermaid has no dedicated use case syntax, so a flowchart with a subgraph stands in.
PlantUML 版
1 | @startuml |
Key points:
actordeclares a participant,usecase "name" as aliasdeclares a use case.rectangle "Order System" { ... }is the system boundary: use cases inside, participants outside.rectangleblocks can be nested, andpackagegives a similar “subsystem” look.-->marks an interaction;..>with<<include>>marks a use case that always reuses another.<<extend>>marks a use case that happens only under certain conditions, drawn with a dashed line.
Mermaid 版
1 | flowchart LR |
Mermaid has no use-case-specific syntax, so a flowchart stands in:
subgraph System["Order System"] { ... }plays the role of PlantUML’srectangleboundary.- Participants are rounded nodes
(["Visitor"]); use cases are rectangles["Browse products"]. - A dashed edge with a label
-. "include" .->expresses the<<include>>relation. - Mermaid edge labels sit in the middle of the line, written as
-. text .->or-- text -->.
对比 / Side-by-side
| Aspect | PlantUML | Mermaid |
|---|---|---|
| Diagram type | Native use case diagram (usecase / actor) |
Generic flowchart (flowchart) emulation |
| System boundary | rectangle "System" { ... } |
subgraph System["System"] { ... } |
| Participant shape | actor Name as Alias (stick figure) |
Rounded node (["Name"]) |
| Use case shape | Ellipse | Rectangle ["Name"] |
| Include relation | UC1 ..> UC2 : <<include>> |
UC1 -. "include" .-> UC2 |
| Extend relation | Native <<extend>> |
Manual dashed edge + label |
小结 / Wrap-up
The practical test for a system boundary is: who benefits from the use case? Put it inside the boundary when the benefit lands on your system; when the use case merely calls out to someone else (payment, shipping, SMS), draw that party as a participant outside the boundary. Both PlantUML’s rectangle and Mermaid’s subgraph can express this layering — the only real difference is that PlantUML understands use case semantics natively while Mermaid relies on your own shape and edge conventions.
- Title: Use case diagrams: where to draw the system boundary
- Author: puml.online
- Created at : 2026-11-05 09:00:00
- Updated at : 2026-11-26 01:07:01
- Link: https://puml.online/blog/use-case-diagram-system-boundary-en/
- License: This work is licensed under CC BY-NC-SA 4.0.