UML Diagrams

3 min read Updated Fri Apr 24 2026 07:36:29 GMT+0000 (Coordinated Universal Time)

UML is a standard visual language for modeling software systems. Used to describe a system’s structure and behavior.

Used to:

  • Design system before coding.
  • Document system architecture.
  • Communicate design with stakeholders.
  • Analyze business processes.

Types

Structure Diagrams

Represent the static organization of a system and relationships between components. Used when designing system architecture.

Class Diagrams

Represents object classes, their attributes, methods, and relationships. Used in object-oriented design.

Relationships used in class diagrams:

  • Association
    A connection between two objects.
  • Inheritance
    Represents a subclass and superclass relationship.
  • Aggregation
    Whole-part relationship, loosely coupled.
  • Composition
    Strong whole-part relationship where parts depend on the whole.
  • Dependency
    One class depends on another for functionality.
  • Realization
    Interface and its implementing class relationship.

Component Diagram

Illustrates system components and their relationships. Shows how components interact to form a system.

Deployment Diagram

Shows the deployment or distribution of software artficats.

Artifacts represent physical elements that are result of the development process.

Object Diagram

Instance of a class diagram. Limited to a specific moment in time.

Package Diagram

Organizes classes into packages.

Composite Structure Diagram

Shows internal structure of a class and its interactions.

Behavior Diagrams

Describe the dynamic behavior of a system when responding to stimuli or events.

Types of stimuli:

  • Data stimuli – input data that must be processed.
  • Event stimuli – events triggering system actions.

Use Case Diagram

Represents system functionality from the user’s perspective, where each use case corresponds to a specific task.

  • Actors – users or external systems.
  • Use cases – tasks performed using the system.

Sequence Diagram

Shows the order of interactions between actors and system objects over time. Illustrated per task, usually.

Actors and objects at the top. Vertical lifelines representing existence over time. Arrows representing message exchanges.

Collaboration Diagram

Focuses on object interactions to achieve a goal.

State Diagram

Displays an object’s states and transitions based on events.

Activity Diagram

Shows system workflows and decision points.

Communication Diagram

Represents messages exchanged between objects.

Timing Diagram

Illustrates time-dependent behavior.

Notations:

  • Class Box: Box with name, attributes, and methods.
  • Arrows: Indicate direction in relationships.
  • Solid Lines: Represent associations.
  • Dotted Lines: Show dependencies.

Benefits of UML

  • Standardized way to visualize system designs.
  • Clarifies complex systems.
  • Scalable for both small and large projects.
  • Improves communication among teams.

Executable UML

Aka. xUML. A subset of UML that allows automatic transformation of models into executable code.

Core model types:

  • Domain models
  • Class models
  • State models

Supporting Technologies:

  • Object Constraint Language (OCL)
  • UML action language