The use case diagram shows all the system requirements, all the interactions and the functionalities that it will have.
# Use Case
A use case is an interaction between a user and a system (it represents an action or subprocess).
It has 3 properties:
-
Captures some function visible to the user
-
Can be small or large
-
Achieves a goal
It is represented by an oval with the name of the action: "Enters", "Analyses risk", "Consults catalog", "Updates accounts".
Examples:
# Actor
Actor, role or type of user that interacts with the system.
It doesn't necessarily have to be a person; it could be another system, for example.
It is represented by a simple drawing of a person, and the role they play is written at the bottom of the representation. For example: "Student", "Teacher", "Administrator", "Accounting system".
It is suggested to be a singular noun.
# Relationship
It is a line that links the actor to the use case. With this, it's possible to determine which part of the program each actor can access (a label is often added indicating the action the user performs in the use case).
# Complete example
What we see in the diagram:
-
Actors: Represented by stick figures. We identify four actors:
- Commerce Manager
- Accounting system
- Merchant
- Sales agent
-
Use Cases: Represented by ellipses. Actions or functionalities that the system offers:
- Sets limits
- Negotiates price
- Captures negotiation
- Updates accounts
- Valuation
- Limit exceeded
-
Relationships: Lines between actors and use cases. There are special relationships:
- <<use>>: Indicates that one use case includes the functionality of another.
- <<extend>>: Shows that one use case can extend another under conditions.
-
Workflow: The direction of the arrows can indicate the interaction flow.
This diagram is useful for understanding how various users or systems interact with the system and with each other, highlighting key functionalities and conditions under which certain actions can occur.
# Conclusions
The use case diagram is an essential tool in UML to have an initial concept of a system. It gives a clear and simple view of what the system should do from the user's point of view.
By using this type of diagram, developers and designers can ensure that the final system is not only functional but also usable and relevant for its end users.