UML
UML
● A Use Case Diagram in Unified Modeling Language (UML) is a visual representation that
illustrates the interactions between users (actors) and a system. It captures the functional
requirements of a system, showing how different users engage with various use cases, or
specific functionalities, within the system. Use case diagrams provide a high-level overview
of a system’s behavior, making them useful for stakeholders, developers, and analysts to
understand how a system is intended to operate from the user’s perspective, and how
different processes relate to one another. They are crucial for defining system scope and
requirements.
● What is a Use Case Diagram in UML?
● A Use Case Diagram is a type of Unified Modeling Language (UML) diagram that represents
the interaction between actors (users or external systems) and a system under
consideration to accomplish specific goals. It provides a high-level view of the system's
functionality by illustrating the various ways users can interact with it.
When to apply Use Case Diagram?
Use case diagrams are useful in several situations. Here’s when you should consider using them:
● When you need to gather and clarify user requirements, use case diagrams help
visualize how different users interact with the system.
● If you’re working with diverse groups, including non-technical stakeholders, these
diagrams provide a clear and simple way to convey system functionality.
● During the system design phase, use case diagrams help outline user interactions and
plan features, ensuring that the design aligns with user needs.
● When defining what is included in the system versus what is external, use case
diagrams help clarify these boundaries.
Use Case Diagram Notations
UML notations provide a visual language that enables software developers, designers, and other
stakeholders to communicate and document system designs, architectures, and behaviors in a
consistent and understandable manner.
1. Actors
Actors are external entities that interact with the system. These can include users, other systems,
or hardware devices. In the context of a Use Case Diagram, actors initiate use cases and receive
the outcomes. Proper identification and understanding of actors are crucial for accurately
modeling system behavior.
2. Use Cases
Use cases are like scenes in the play. They represent specific things your system can do. In the
online shopping system, examples of use cases could be "Place Order," "Track Delivery," or
"Update Product Information". Use cases are represented by ovals.
● Use Case Diagram Relationships
In a Use Case Diagram, relationships play a crucial role in depicting the interactions between actors and use cases. These relationships
provide a comprehensive view of the system's functionality and its various scenarios. Let's delve into the key types of relationships and
explore examples to illustrate their usage.
1. Association Relationship
The Association Relationship represents a communication or interaction between an actor and a use case. It is depicted by a line connecting
the actor to the use case. This relationship signifies that the actor is involved in the functionality described by the use case.
● Actor: Customer
● Use Case: Transfer Funds
● Association: A line connecting the "Customer" actor to the "Transfer Funds" use case, indicating the customer's involvement in
the funds transfer process.
2. Include Relationship
The Include Relationship indicates that a use case includes the functionality of another use case. It
is denoted by a dashed arrow pointing from the including use case to the included use case. This
relationship promotes modular and reusable design.
Example: Social Media Posting
The Extend Relationship illustrates that a use case can be extended by another use case under
specific conditions. It is represented by a dashed arrow with the keyword "extend." This
relationship is useful for handling optional or exceptional behavior.
Example: Flight Booking System
The Generalization Relationship establishes an "is-a" connection between two use cases,
indicating that one use case is a specialized version of another. It is represented by an arrow
pointing from the specialized use case to the general use case.
Example: Vehicle Rental System
● Step 1: Identify Actors: Determine who or what interacts with the system. These are your actors. They can be users, other
systems, or external entities.
● Step 2: Identify Use Cases: Identify the main functionalities or actions the system must perform. These are your use cases.
Each use case should represent a specific piece of functionality.
● Step 3: Connect Actors and Use Cases: Draw lines (associations) between actors and the use cases they are involved in. This
represents the interactions between actors and the system.
● Step 4: Add System Boundary: Draw a box around the actors and use cases to represent the system boundary. This defines
the scope of your system.
● Step 5: Define Relationships: If certain use cases are related or if one use case is an extension of another, you can indicate
these relationships with appropriate notations.
● Step 6: Review and Refine: Step back and review your diagram. Ensure that it accurately represents the interactions and
relationships in your system. Refine as needed.
● Step 7: Validate: Share your use case diagram with stakeholders and gather feedback. Ensure that it aligns with their
understanding of the system's functionality.
Use Case Diagram example(Online Shopping System)
Let's understand how to draw a Use Case diagram with the help of an Online Shopping System:
● Actors:
○ Customer
○ Admin
● Use Cases:
○ Browse Products
○ Add to Cart
○ Checkout
○ Manage Inventory (Admin)
● Relations:
○ The Customer can browse products, add to the cart, and complete the checkout.
○ The Admin can manage the inventory.