A use case must yield an observable result that is of value to the user of the system.
Actors: an icon for that actor
Represents with an icon for that actor
An actor represents a role of a user that interacts with the system that you are modeling.
The user can be a human user, an organization, a machine, or another external system.
Subsystems/System boundary: a folder
Represents with a folder
Subsystems are a type of stereotyped component that represent independent, behavioral units in a system.
Subsystems are used in class, component, and use-case diagrams to represent large-scale components in the system that you are modeling.
Relationships in use-case diagrams:
Represents with a simple arrow
A connection between model elements.
A UML relationship is a type of model element that adds semantics to a model by defining the structure and behavior between the model elements.
Types of relationship:
include: show that the same set of actions are included in several use cases.
The included actions are shown as a use case and linked to relevant actors.
it also include (trigger) UC2 if i do UC1→ UC2 includes UC1
extend: show that a set of actions sometimes occur in a base use case; the actions do not always have to be executed as part of that base use case.
These extension actions are shown as separate use cases
Base use case does not do anything about extension use cases – it just provides hooks for them. In fact, the base use case is complete without extensions
i can also optionally/conditionally triggers UC2 if i do UC1→ UC2 extends to UC1
generalization/inheritance: when two or more use cases have commonalities in behaviour, structure, and purpose.
A solid arrow from the child use case pointing to the parent use case.
Actor Generalization: Actor generalization factors out behaviour common to two or more actors into a parent actor.
Draw
skinparam monochrome true left to right direction actor Guest as g package Professional { actor Chef as c actor "Food Critic" as fc } package Restaurant { usecase "Eat Food" as UC1 usecase "Pay for Food" as UC2 usecase "Pay by card" as UC2a usecase "Pay by cash" as UC2b usecase "Drink" as UC3 usecase "Review" as UC4 } fc --> UC4 g --> UC1 g --> UC2 g --> UC3 UC1 .> UC2 : include UC3 .> UC1: extends UC2a --> UC2 UC2b --> UC2