Understanding Use Case Diagrams in UML
What is a Use Case Diagram?
● A visual representation in Unified Modeling Language (UML)
● Shows interactions between users (actors) and a system
● Captures functional requirements of a system
● Provides a high-level overview of system behavior
● Useful for stakeholders, developers, and analysts
When to Apply Use Case Diagrams
● To gather and clarify user requirements
● When working with diverse groups, including non-technical
stakeholders
● During the system design phase
● To define system boundaries (what's included vs. external)
● What other situations can you think of where these diagrams
might be useful?
Key Elements: Actors
● External entities that interact with the system
● Can include users, other systems, or hardware devices
● Initiate use cases and receive outcomes
● Crucial for accurately modeling system behavior
● Can you give an example of an actor in a system you use?
Key Elements: Use Cases
● Represent specific things your system can do
● Depicted as ovals in the diagram
● Examples: "Place Order," "Track Delivery," "Update Product
Information"
● What might be a use case for a school library system?
● Help define the functionality of the system
Key Elements: System Boundary
● Visual representation of the system's scope or limits
● Defines what is inside and outside the system
● Represented by a rectangular box surrounding use cases
● Establishes clear distinction between internal and external
elements
● Why do you think it's important to define system boundaries?
Relationship: Association
● Represents communication between an actor and a use case
● Depicted by a line connecting the actor to the use case
● Signifies the actor's involvement in the use case functionality
● Example: Customer (actor) connected to "Transfer Funds" (use
case)
● Can you think of an association in a video game system?
Relationship: Include
● Indicates that one use case includes functionality of another
● Shown as a dashed arrow pointing to the included use case
● Promotes modular and reusable design
● Example: "Compose Post" includes "Add Image" in social media
● How might this relationship be useful in designing complex
systems?
Relationship: Extend
● Shows that a use case can be extended by another under
specific conditions
● Represented by a dashed arrow with keyword "extend"
● Useful for handling optional or exceptional behavior
● Example: "Select Seat" extends "Book Flight" in airline system
● Can you think of an "extend" relationship in a school registration
system?
Relationship: Generalization
● Establishes an "is-a" connection between two use cases
● One use case is a specialized version of another
● Represented by an arrow pointing from specialized to general
use case
● Example: "Rent Car" and "Rent Bike" generalize to "Rent
Vehicle"
● How might this relationship help in organizing system functions?
How to Draw a Use Case Diagram: Steps 1-3
● Step 1: Identify Actors (who or what interacts with the system)
● Step 2: Identify Use Cases (main functionalities of the system)
● Step 3: Connect Actors and Use Cases with lines (associations)
● These steps lay the foundation for your diagram
● Why do you think it's important to start with these steps?
How to Draw a Use Case Diagram: Steps 4-7
● Step 4: Add System Boundary (box around actors and use
cases)
● Step 5: Define Relationships (include, extend, generalization)
● Step 6: Review and Refine your diagram
● Step 7: Validate with stakeholders and gather feedback
● Which step do you think might be the most challenging? Why?
Example: Online Shopping System
● Actors: Customer, Admin
● Use Cases: Browse Products, Add to Cart, Checkout, Manage
Inventory
● Customer can browse, add to cart, and checkout
● Admin can manage inventory
● Can you think of additional use cases for this system?
Example: Online Shopping System
https://www.geeksforgeeks.org/use-case-diagram/
Tools for Creating Use Case Diagrams
● Lucidchart: Cloud-based collaborative platform
● draw.io: Free, open-source diagramming tool
● Microsoft Visio: Part of Microsoft Office suite
● SmartDraw: User-friendly with various templates
● PlantUML: Text-based, open-source tool
Common Mistakes to Avoid
● Adding too much detail (can confuse people)
● Unclear connections (lead to misunderstandings)
● Inconsistent naming (creates confusion)
● Incorrect use of generalization
● Failing to define system limits
● Treating the diagram as static (not updating as system
changes)
Best Practices
● Focus on core functions, avoid unnecessary details
● Use uniform naming scheme for clarity
● Ensure consistent appearance of diagram elements
● Organize use cases into coherent groups
● Adopt an iterative approach, updating as needed
● Why do you think these practices are important?
Purpose and Benefits
● Provides clear visual representation of system functions
● Establishes shared language for articulating requirements
● Illustrates different ways users engage with the system
● Supports planning of user interfaces and system structure
● Enhances communication among stakeholders
Use Case Diagrams in Agile Methodologies
● Provide clear overview of user requirements
● Help prioritize features based on user needs
● Support iterative development processes
● Facilitate communication between team members and
stakeholders
● How might these benefits apply to a school project?
Include vs. Extend Relationships
● Include: Indicates mandatory, reused functionality across use
cases
● Extend: Represents optional behavior enhancing a use case
● Include uses solid arrow, Extend uses dashed arrow
● Include is always performed, Extend is conditional
● Can you think of an example of each in a library system?
Importance of System Boundaries
● Define the scope of the system
● Clarify what's included in the system versus what's external
● Help manage project scope
● Assist in identifying interfaces with external systems
● Why might defining boundaries be challenging in some
projects?
Conclusion and Reflection
● Use Case Diagrams are powerful tools for visualizing system
requirements
● They improve communication and understanding among
diverse stakeholders
● Remember to keep diagrams clear, focused, and up-to-date
● What's one new thing you learned about Use Case Diagrams?
● How might you use this knowledge in your future projects?