Skip to main content

Short note: Sequence diagram

Short answer

A sequence diagram is a UML interaction diagram showing object interactions in a use case scenario with time order top to bottom. Notation includes lifelines, activation bars, synchronous/asynchronous/return messages, self-messages, object creation/destruction, and combined fragments (alt, opt, loop). It models detailed flow, identifies class methods, and documents system behavior and test cases.

Write a short note on Sequence diagram.

A sequence diagram is a UML interaction diagram that shows how objects interact in a particular scenario of a use case, with the time order of messages emphasised. Time runs from top to bottom.

Notation

  • Object/participant: rectangle at top, name:Class.
  • Lifeline: vertical dashed line showing the object's existence over time.
  • Activation bar (focus of control): thin rectangle on a lifeline while the object is executing.
  • Message: horizontal arrow; solid with filled head = synchronous call, open head = asynchronous, dashed = return.
  • Self message: arrow looping to the same lifeline.
  • Object creation/destruction: a message to a new object box; an X at the end of a lifeline.
  • Combined fragments: alt, opt, loop boxes for conditions and repetition.
 :Customer    :ATM         :Bank
     | insertCard |           |
     |----------->|           |
     |            | verify()  |
     |            |---------->|
     |            |<- - - - - |
     |<- - - - - -|  ok       |
     |            |           |

Uses

  • Model the flow of one use case scenario in detail.
  • Identify the methods needed in classes.
  • Document the system behaviour and test cases.

A system sequence diagram is a special case that treats the whole system as one black box lifeline and shows the actor's events.

✓ Answer checked by Claude Opus 5.5 (high effort)

All Object Oriented Analysis and Design chapter 2 questions →