Lecture 06 Sequence Diagrams
Lecture 06 Sequence Diagrams
Design
Lecture 6 – Sequence Diagrams
Muhammad Zeeshan Sabir
Sequence Diagram
• An SSD shows, for a particular course of events within a use case
• Describe flow of messages, events, actions between objects
• Show concurrent processes and activations
• Show time sequences that are not easily depicted in other diagrams
• Typically used during analysis and design to document and
understand logical flow of your system
Cont…
• Two-dimensional diagram
• Horizontal axis: involved interaction partners
• Vertical axis: chronological/ sequential order of the
interaction
• Interaction = sequence of event specifications
Interaction Partners
• Interaction partners are depicted as lifelines
• Head of the lifeline
• Rectangle that contains the expression
• Body of the lifeline
• Vertical, usually dashed line
• Represents lifetime of the object associated with it
Head of lifeline
Body of Lifeline
Representing Objects
• Squares with object type, optionally preceded by object name and
colon
• write object's name if it clarifies the diagram
• object's "life line" represented by dashed vert. line
Exchanging Messages
• Interaction: sequence of events
• Message is defined via send event and receive event
• Execution specification
• Continuous bar
• Used to visualize when an interaction partner executes some
behavior
Operator
Operand
Operand
Operand
Types of Combined Fragments
Cont…
• if -> (opt) [condition]
• if/else -> (alt) [condition], separated by horizontal dashed line
• loop -> (loop) [condition or items to loop over]
opt Fragment
• To model an optional
sequence
• Actual execution at runtime is
dependent on guard
• Exactly one operand
• Similar to if statement
without else branch
alt Fragment