UML Use Case Diagram
A UML use case diagram shows the functions a system provides and how users or other systems interact with it.
1. Actors
Represent users or external systems that interact with the system. Actors are drawn as stick figures and placed outside the system boundary.
Example: Customer, Administrator, Database.
Represent the functions or tasks that the system performs. Use cases are drawn as ovals and labelled with a short description.
Example: Search for Food, View Results, Add Item.
A rectangle showing the limits of the system. Use cases are placed inside the rectangle, while actors are placed outside it.
4. Association lines
Solid lines connecting actors to use cases. They show which actors interact with which functions.
Include
Shows that one use case always uses another use case as part of its process.
-
The included function is required.
-
Drawn using a dashed arrow pointing towards the included use case.
-
Label the arrow <<include>>.
Example: Search for Food includes Display Search Results.
Extend
Shows that an additional use case can add optional behaviour to another use case.
-
The extra behaviour only happens when a particular condition is met.
-
Drawn using a dashed arrow pointing towards the original use case being extended.
-
Label the arrow <<extend>>.
Example: Apply Discount extends Checkout, if the customer has a valid discount code.
WDD / DDD Guidance
Your use case diagram should include use cases relevant to the specific features of your website.
- Search: Include a use case for searching the database, linked to the relevant functional requirement (FR).
- Formatted Search Output: Include a use case showing how the search results are formatted and displayed to the user. Link this to the relevant FR.
- Session Variables: If your website uses session variables to provide functionality for an individual user, include a use case showing what the session variable does. For example, displaying the user’s last search at the top of each page. Link this to the relevant FR where applicable.
- Media Query: Include a use case showing how a CSS media query adapts the website layout for different screen sizes, such as desktop and mobile. Link this to the relevant FR where applicable.