Sequence Diagram   «Prev  Next»
Lesson 2Review sequence diagram notation
ObjectiveReview the Notation for a Sequence Diagram

Review Sequence Diagram Notation

The sequence diagram illustrates objects talking to one another over time. To do so, the diagram uses objects, timelines, and event arrows. The diagram consists of a set of participating objects lined up across the top of the diagram. A timeline is drawn down from each object.
Sequence Diagram
Timeline, Sequence number
  1. Event/message
  2. Return
  3. Sequence number
  4. Self-reference
  5. Object name
  6. Anonymous object
  7. Iteration comment
  8. Basic comment
  9. Event signature
  10. Condition

Sequence Diagram Example
You will note from the diagram above:
  1. The objects use standard object notation, that is, a rectangle containing the object name, a colon, and the class name of the object. All three of these elements are underlined. The object name is optional. You may use just the colon and class name:
    ObjectName:ClassName
  2. The timeline is a vertical dashed line.
  3. The events appear as arrows.

Domain Driven Design

Event Shown Horizontal

An event is shown as a horizontal arrow from the timeline of the "sending" object to the timeline of the "receiving" object. A return from an event is shown as a horizontal arrow from the "receiving" object back to the "sending" object.

Return Arrow Line

Some tools support a different kind of line for the return arrow, for example, a dashed line instead of a solid line. This is extremely useful because the two events are handled so differently.

Order of events

The position on the timeline indicates a relative point in time. The top of the line represents the beginning of the timeline. The bottom represents the end of the timeline.