CSCI 370 Lec 18: Use Case, Sequence, and State Diagrams in UML

Thursday, April 24


Use Case Diagrams: Modeling System Interactions

Use case diagrams provide a high-level overview of a system’s functional requirements and how different users (actors) interact with the system.

Core Elements

  1. Actors: Stick figures outside the system box representing users or external systems.
  2. System Boundary: A large rectangle labeled with the system name (e.g., “Online Shopping System”).
  3. Use Cases: Ovals inside the system boundary that represent activities or services the system offers.
  4. Relationships:

    • Association: A solid line from an actor to a use case indicating interaction.
    • «include»: Indicates that one use case includes behavior from another.
    • «extend» (not shown here): Represents optional or conditional behavior.

Example Breakdown

In the diagram titled Online Shopping System:

[Insert image: insert__use_case_diagram__here]


Context Diagrams: System Ecosystem Overview

A context diagram offers a simplified, high-level view of the system and its interactions with external entities.

Characteristics:

This diagram is useful for visualizing what systems or users communicate with your application, without going into implementation details.


Activity Diagrams with Swimlanes

Activity diagrams visualize workflows within a system, often structured using swimlanes to denote different roles or components.

Swimlane Explanation:

[Insert image: insert__activity_diagram_with_swimlanes__here]


Sequence Diagrams: Timeline of Interactions

Sequence diagrams illustrate how objects interact over time.

Key Concepts:

Example:

Sequence diagrams are ideal for modeling real-time system behavior.


State Diagrams: Tracking Object State Transitions

State diagrams model the lifecycle of a single object as it transitions between various states.

Components:

Example:

For a car engine and transmission system:

This diagram helps reason about allowable and disallowed system conditions and transitions.


Summary of Diagram Types:

Diagram Type Purpose Notable Features
Use Case Shows user interaction with system Actors, use cases, «include» links
Context High-level external system relationships System as a circle; external actors
Activity Workflow and task order Swimlanes, decisions, forks/joins
Sequence Time-ordered object interactions Lifelines, activation, messages
State Object state transitions Initial/final states, transitions

Each diagram plays a distinct role in software modeling, helping developers and stakeholders visualize and analyze different system aspects.