Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Elements of sequence diagrams

One page per symbol of a sequence diagram: what it looks like, its syntax and the UML 2.5.1 clause it follows. Use these pages to look something up; to write a whole diagram, start with Sequence diagrams.

ElementSyntax
Lifelineparticipant, actor
Messagea -> b, a ->> b, a --> b, [-> a, a ->]
Executiona -> b : call { ... }, return
Creation and destructiona -> new "B" as b, create, destroy
Combined fragmentalt, opt, loop, break, critical, neg, par
Interaction useref over a, b : Name
Notenote over a: text
diagram sequence "All the sequence elements"

actor User as u
participant Server as s

u -> s : request() {
  opt "cached" {
    return hit
  }
  s -> new "Worker" as w : start
  destroy w
  return result
}
note over s: Stateless.
All the sequence elements opt [cached] User Server Worker Stateless. request() hit start result

See Sequence diagrams for how to write one, and the grammar for every statement.