Use-Case Diagrams
Actors, use cases and the system boundary, plus «include», «extend» and generalization - how to show what a system does for whom before designing how.
A use-case diagram answers one question: who uses the system, and for what? It is drawn before any class or table exists. Each oval names a goal an outside party reaches with the system; the stick figures are those parties; the rectangle is the edge of the system. Nothing about screens, data or call order belongs here — those come later, in class diagrams and sequence diagrams.
The notation
| Element | Drawn as | Means |
|---|---|---|
| Actor | A stick figure with a name | A role outside the system that interacts with it |
| Use case | An ellipse with a verb phrase | A goal the system fulfils for an actor |
| System boundary | A rectangle around the use cases, named | What is inside the system (and so, what is not) |
| Association | A plain line between an actor and use case | This actor takes part in this use case |
| «include» | A dashed arrow from base to included | The base use case always performs the included one |
| «extend» | A dashed arrow from extension to base | The extension sometimes adds behavior to the base |
| Generalization | A hollow-triangle arrow to the general one | A specialised actor or use case inherits the general one |
Actors are roles, outside the system
An actor is a role, not a person: one librarian may also borrow books and so play both Librarian and Member. Actors can be other systems too — a payment provider, a scheduler that fires every night. They always sit outside the boundary; an actor drawn inside it reads as part of the system.
Use cases are goals
Name a use case as a verb phrase an actor would say: Borrow Book, Pay Fine, Place Order. A noun such as "Registration" or "Payment" names data or a feature, not a goal. One use case should leave the system in a consistent state in one sitting — "Update loan row" is a step, not a goal.
«include» and «extend»
«include» factors out behavior that several use cases always need. Borrow Book and Renew Loan both include Authenticate Member: the arrow points from the base to the included use case, and the base cannot finish without it.
«extend» adds optional behavior at a point in the base. Apply Coupon extends Place Order: the arrow points from the extension to the base, and Place Order still works without it. The condition and the extension point can be written in a note on the arrow.
(Borrow Book) --«include»--> (Authenticate Member)
(Apply Coupon) --«extend»--> (Place Order)Generalization
A specialised actor inherits every association of the general one: a Graduate Student can do everything a Student can, plus Request Thesis Supervisor. Use cases can be generalized the same way (Pay by Card specialises Pay Fine). Draw the hollow triangle at the general end, as in generalization between classes.
Reach for it
- Agreeing on a system's scope with users before design starts
- Listing the goals each kind of user must be able to reach
- Splitting work into features that each deliver something to an actor
Avoid it
- Showing the order of steps or messages - use a sequence diagram
- Modelling data or classes - use a class or ER diagram
- Drawing every screen or button as a use case
Common mistakes
Actors inside the boundary. The boundary encloses the system's use cases only. Move the actor outside.
Lines between actors and «include» arrows to actors. Associations connect an actor to a use case; «include» and «extend» connect two use cases; generalization connects like with like.
Arrows on associations. An actor–use case association is conventionally drawn as a plain line. UML permits a navigability arrow, but it adds little here; direction belongs to «include», «extend» and generalization.
Practice
Draw the use cases of an online shop: a Customer who browses the catalog, places orders and tracks them, and a Payment Provider that takes part in paying. Make paying an «include» of Place Order and applying a coupon an «extend». Then open the use-case studio and compare with the worked example.