Creating a use case diagram
A use case diagram models the behavior of a system and helps to capture the requirements. It identifies the interactions between the system and its actors, and defines the scope of the system.
- Represents a role of a user that interacts with the system. The user can be a human user, an organization, a machine, or another external system.
- Use case
- Describes a function that a system performs to achieve the user's goal. A use case must yield an observable result that is of value to the user of the system.
The use cases and actors shown in a use case diagram describe what the system does and how the actors use it, but not how the system operates internally. To relate an actor and a use case, you can create an association relationship to indicate the connection between the two model elements.
For our simple phone book application, assume there is only one actor, Any User, who can carry out the following two use cases against the system:
- Add an entry
- Enter a unique person name and a phone number using the provided application user interface. The system processes the entered data and stores it.
- Search for a phone number
- Retrieve a phone number by entering a unique person name using the provided application user interface. The system locates the phone number and returns it to the actor.
To create a use case diagram that lists the two use cases:
- In the Model Explorer view, right-click Phone Book UML Model and select
Add Diagram > Use Case Diagram.
Figure 4. Adding a use case diagram
User Case Diagramas the name of the generated diagram to replace the default name Diagram1. Now you can draw the use case diagram by adding various model elements from the Palette to the diagram.
Figure 5. Adding model elements
- Select Actor in the Palette, then click anywhere in the diagram to create an Actor.
- Select Use Case in the Palette, then click anywhere in the diagram to create a Use Case.
Add an entry.
- Similarly, create another use case called Search for a phone number.
- Select Association in the Palette. Draw the association relationship line from the actor Any User to the use case Add an entry to initiate a relationship between the two model elements.
- Similarly, create another association relationship between the actor Any User and the use case Search for a phone number.
- The complete use case diagram should look similar to Figure 6. Select Ctrl-S to save
Figure 6. Complete use case diagram