Brunel University LondonDr Giuseppe Destefanisgiuseppe.destefanis@brunel.ac.uk@GiuseppeDes
Sequence diagrams model the interactions between objects.
They illustrate how messages and data are exchanged during interactions.
Horizontal Axis: Represents interaction partners (actors or systems)
Vertical Axis: Represents the chronological order of interactions
Depicted as lifelines:
Head of Lifeline: Rectangle showing role. Example: roleName:Class
Body of Lifeline: Dashed vertical line representing the lifetime of the interaction partner.
Message Types:
Synchronous: Sender waits for a response before proceeding
Asynchronous: Sender continues immediately without waiting for a response.
Response message: Optional; delivered back to the sender.
Object creation and destruction:
Creation: Dashed arrow points to the new object's lifeline with the keyword new
.
Destruction: Large cross marks the end of a lifeline.
Used to model various control structures in interactions.
Types of Operators:
alt: For alternative interactions (like switch
)
opt: For optional interactions (like if
)
loop: For repeated interactions (iterations)
break: For exception handling.
alt: Alternative sequences using guards to determine path.
opt: Optional sequence based on a guard, one operand.
loop: Repeated execution of an operand, specifies iterations.
seq: Default order of events, allows weak sequencing.
strict: Ensures strict ordering of messages long various lifelines.
par: Concurrent paths can interleave, but order of operands is irrelevant.
alt Fragment Example:
Used to model different paths based on a condition, similar to switch statements.
loop Fragment Example:
Details execution with specific minimum and maximum iterations.
strict Fragment Example:
Ensures messages are passed in a precise order between interaction partners.
Lifeline: Represents interaction partners involved.
Destruction Event: Indicates when an interaction partner ceases to exist.
Combined Fragment: Denotes different control constructs within the interaction.