Skip to content
IRC-Coding IRC-Coding
Sequence Diagram UML Message Flow Lifelines Activation Bars alt opt loop Interaction Diagram

Sequence Diagrams: Message Flow, Lifelines, Activation Bars

Learn sequence diagrams: visualize temporal message flow between objects using lifelines and activation bars in UML.

S

schutzgeist

2 min read
Sequence Diagrams: Message Flow, Lifelines, Activation Bars

Sequence Diagram (UML) – Message Flow, Lifelines, Activation Bars, alt, opt & loop

This post is a glossary entry on sequence diagrams – including exam questions and tags.

In a Nutshell

A sequence diagram represents the chronological sequence of messages between objects or system components at runtime.

Compact Technical Description

Sequence diagrams are part of UML and serve to represent interactions between various actors, system components, or objects in a chronological sequence. They show how messages (e.g., method calls) are exchanged between the participants, including their order and responses. The vertical axis symbolizes the passage of time, while the horizontal lanes (lifelines) represent the participants. With control structures such as alt, opt, or loop, conditions, alternatives, or repetitions can be modeled.

Exam-Relevant Key Points

  • Part of UML for modeling dynamic processes
  • Representation of message flows and their sequence
  • Use of lifelines and activation bars
  • Models system behavior from a communication perspective (IHK-relevant)
  • Helpful in analysis, design, and test case development
  • Detection of synchronization problems and error flows
  • Supports precise process planning and effort estimation
  • Serves as documentation basis for development teams

Core Components

  1. Actor (e.g., user, admin)
  2. Lifeline
  3. Activation bar
  4. Message (synchronous/asynchronous)
  5. Response/return message
  6. Control structure alt (alternative)
  7. Control structure opt (optional action)
  8. Control structure loop (repetition)
  9. Object creation/destruction
  10. Temporal synchronization

Practical Example

// Example: User logs in
User -> UI : Enter credentials
UI -> Service : Submit credentials
Service -> DB : Query user data
DB --> Service : Result (valid/invalid)
alt Credentials correct
  Service -> UI : Redirect to home page
  UI -> User : Display home page
else Credentials incorrect
  Service -> UI : Return error message
  UI -> User : Display error message
end

Explanation: The diagram shows the interaction in a login process with conditional branching for success/failure.

Advantages and Disadvantages

Advantages

  • Clear representation of processes
  • Visualizes interaction and sequence
  • Ideal for technical communication

Disadvantages

  • Can become confusing with complex systems
  • Only suitable for sequential logic
  • No direct representation of parallelism

Typical Exam Questions (with Short Answers)

  1. What is a sequence diagram? UML diagram for representing chronological processes between system components.
  2. Lifeline? Vertical line representing an object during its existence in the process.
  3. What do activation bars serve? Show when an object is actively involved in execution.
  4. What control structures can be used? alt (alternative), opt (optional), loop (repetition).
  5. How is an error situation represented? With an alt block to distinguish between success and error cases.
  6. Why are sequence diagrams important for testing? They help define and verify expected processes precisely.
  7. Synchronous vs. asynchronous message? Synchronous messages block the sender until a response is received, asynchronous messages do not.
  8. How are security requirements represented? Through explicit representation of security-relevant actions such as authentication.

Most Important Sources

  1. https://plantuml.com/en/sequence-diagram
  2. https://www.guru99.com/sequence-diagram-uml.html
  3. https://www.visual-paradigm.com/guide/uml-unified-modeling-language/what-is-sequence-diagram/
Back to Blog
Share:

Related Posts