UML Use Case Diagram
UML Use Case Diagram
Have you ever found flowcharts interesting? The ability of flowcharts is to explain complex
algorithms with step by step instructions in various shaped boxes – it has always been an easy
way to pictorially depict any algorithm or process. UML diagrams are an advanced version of
flowcharts. Let us understand each term.
Sounds like quite a heavy worded title, doesn’t it? Well, let’s break it down to each word.
UML
UML Diagrams
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.
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:
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, when the activity diagram also models the actions of the system
based on the inputs?
Ans: 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.
Well then, sequence diagrams involve actors and the actions they perform at
various stages. Why use-case?
Ans: 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.
Ans. 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 little too detailed for his
purpose.
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?
Ans. 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
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.