UML Use Case Diagram
UML use case diagram is one of the types of UML diagram which is used to represent the dynamic diagram by mapping the structure of the systems using actors and use cases. Where use cases are used to represent the set of activities, services that the system needs to perform, and actors are the entity that works under defined roles within the system. Use case diagram is useful for representing the functional requirements of the system using various notations like system, use case, actors, and relationships.
What is UML Use Case Diagram?
It sounds like quite a heavy worded title, doesn’t it? Well, let’s break it down to each word.
Unified Modelling Language is a modern approach to the conventional process of modeling and documenting software. This approach is a diagrammatic representation of the components and processes involved in software. It is like explaining the whole software through visual representations so that it is easy to understand and weed out possible flaws and errors in the system. The whole process falls under the larger umbrella of business process modeling techniques.
Picture those real-life scaled models of various vast architectures such as a mall or a housing society spread across acres, placed inside nice shiny glass boxes at the reception of the structure. Isn’t it easy to understand the complete structure when it has been modeled as-a-whole before your eyes?
Well, UML Diagrams are software what those scaled models are to the actual structure. A complete representation of the whole system or a part of it, with the help of diagrams. There are various diagrams serving various purposes. Some examples are:
- Class diagram: Focuses more on the blueprint.
- Sequence diagram: Focuses more on the process from a system perspective.
- Activity diagram: Focuses on the actions from a user perspective.
- Use case diagram: Focuses on the business requirements and many more.
UML Use Case Diagram
The center topic of today’s discussion is the Use Case diagrams. A Use Case diagram models the dynamic behavior of the system when it is operating. It highlights the high-level requirements of the system. It is modeled to represent the outside view of the system. The use-case diagram explains the various use-cases in which an end-user can interact with the system. The perspective in the picture is of the end-user.
A simple example of a use-case diagram is how an end-user interacts with the airline ticket booking system. Some of the use cases in this example could be, but not limited to:
- A person logs in to search for flights.
- A person books a flight.
- A person views his previous flight bookings.
- A person web-checks in his flight.
- A person cancels his flight.
and some more, Let’s Dive In…
As said earlier, a use case diagram models the dynamic behavior of the system. Notice the word dynamic. This implies that there must be some internal or external factors that influence the behavior of the system during run time and make it dynamic in nature. These internal or external agents are known as Actors. A Use-case diagram models the actors, the system, and their interaction. A single use-case diagram can model a particular functionality of the system.
Why Use Case diagram?
That’s the curious side of you talking. Let’s analyze through some QnA.
1. Why use-case when the activity diagram also models the actions of the system based on the inputs?
Yes, but the use case diagram does it from the perspective of the end-user, whereas the activity diagram does it from the system perspective. An end-user may not know his role through an activity diagram.
2. Well then, sequence diagrams involve actors and the actions they perform at various stages. Why use-case?
Sequence diagrams are more detailed versions of user-system interaction. They also involve the internal functioning of the system, interaction between sub-modules and the time elapsed during internal functioning. An end-user may not be interested in such details. He is concerned with the overall output of the system.
3. I know collaboration/communication diagrams are a simpler version of sequence diagrams. Why can’t I use them?
Collaboration diagrams are indeed simpler, yet they focus mainly on the communication between the components. This still involves more focus on the messages that are exchanged between the system and sub-modules. An end-user may still find it a little too detailed for his purpose.
4. There is a state-chart diagram as well. They are simple, don’t involve internal sub-modules and depict end-user interactions as well. How does the use-case diagram beat it?
The primary purpose of state-chart diagrams is to analyze the state of the system at every possible point in time. They are more suitable for debugging and reverse-engineering of the system. Use case diagrams skip the intermediate states of the system as the end-user may not be interested in knowing all the states the machine goes through. Moreover, state-chart diagrams don’t focus on the overall requirement as use-case diagrams do. They focus more on a specific input and the concerned output.
So, the takeaway from this discussion is that while many UML diagrams perform similar functionalities, yet they have a distinguished role in understanding the system. A Use-case diagram is as important as any other diagram for the overall documentation of the system components of Use case diagrams.
Example of use-case Diagram
Below is a simple example of a use-case diagram for the Airline Ticket booking system. This diagram can be made more comprehensive with the introduction of other actors such as booking operators, banks, etc. It has been simplified to demonstrate how a use-case diagram is made.
Use case diagrams are simple yet effective for understanding the system from the outside. They are very helpful for the business to define high-level requirements and analyze flaws in the requirements as well. Understanding use-case diagrams help the business as well as the technical team to get on the same page in terms of requirements.
This has been a guide to the UML Use Case Diagram. Here we discussed what is UML Case Diagram and why it is used, and components of this diagram. You can also go through our other suggested articles to learn more –