Sequence Diagram Overview
Defining a Simple Sequence Diagram
Original syntax and explanations: http://www.spinellis.gr/sw/umlgraph/doc/seq-simple.html
Alternate syntax:
S : s:Switch P : p:Pump S -> P run() S -> P stop()
An Improved Sequence Diagram
Original syntax and explanations: http://www.umlgraph.org/doc/gui-db.html
Alternate syntax:
S : s:Switch P : p:Pump S+ P+ S -> P run() S -> P stop()
Creating and Destroying Objects
Original syntax and explanations: http://www.spinellis.gr/sw/umlgraph/doc/seq-cd.html
Alternate syntax:
S : s:Switch P : p:Pump F : S+ P+ S -> P run() P :> F+ f:Flow S -> P stop() P #> F
Sequence Diagram Examples
Sequence Diagram Example: Nested Activation and Complex Interactions
Original syntax and explanations: http://www.spinellis.gr/sw/umlgraph/doc/uml-appa.html
Alternate syntax:
E : # External Messages T : t:thread O : :Toolkit P : E -> T+ a1:run(3) : T -> O+ run() : O >callbackLoop() O+ :> P p:Peer O- => P result=handleExpose() O #> P T- O-
Sequence Diagram Example: Concurrent Processes and Activations
Original syntax and explanations: http://www.spinellis.gr/sw/umlgraph/doc/dist-52.html
Alternate syntax:
boxwid = 1.3; E : #External actor T : TC : TC1 : TC2 : E :> T+ a:Transaction T- ?:> TC+ a:TransCoord TC ?:> TC1+ a1:TransCheck TC ?:> TC2+ a2:TransCheck TC <-? TC1 ok : TC >all done ? : TC- TC1~ : TC+ <-? TC2 ok : TC >all done ? TC2~ T+ <-? TC- beValid
Sequence Diagram Example: Create and Destroy
Original syntax and explanations: http://www.spinellis.gr/sw/umlgraph/doc/uml-182.html
Alternate syntax:
boxwid = 1.1; C : c:Client T : #:Transaction P : p:ODBCProxy C+ C :> T Transaction {{Transient}} C -> T+ setActions (a,d,o) T -> P! setValues (d,3.4) T -> P! setValues (a,"CO") C <= T- committed C- #> T
Sequence Diagram Example: Lifeline Constraints
Original syntax and explanations: http://www.spinellis.gr/sw/umlgraph/doc/uml-184.html
Alternate syntax:
S : s:Caller W : :Switch C : #c:Convers R : r:Caller W+ S+ ?-> W liftReceiver S <- W setDialTone() S ?-> W *dialDigit(d) W {{dialing.executionTime < 30s}} W >routeCalls(s,n) W :> C+ c:Convers C -> R+ ring() C <-? R liftReceiver W <- C connect(r,s) S <- W connect(r) W -> R <(> connect(s)
Sequence Diagram Example: External Actor
Original syntax and explanations: http://www.spinellis.gr/sw/umlgraph/doc/uml-71.html
Alternate syntax:
A * #Actor T : :OTaker F : :OFulfill A -> T submitOrder T -> F placeOrder A <- F acknowledgeOrder
Sequence Diagram Example: A DNS Query
Original syntax and explanations: http://www.spinellis.gr/sw/umlgraph/doc/dns.html
Alternate syntax:
boxwid = 1.3; WB : :Web Bowser WK : :Workstation Kernel SK : :Server Kernel DS : :DNS Server WB+ WK+ SK+ DS+ SK <- DS- select WB -> WK socket WB -> WK connect WB -> WK sendto WK -> WK send packet WK -> SK DNS A query WB- -> WK recvfrom SK -> SK receive packet SK => DS+ select returns SK <- DS recvfrom SK <- DS sendto SK -> SK send packet WK <- SK DNS A reply WK -> WK receive packet WB+ <= WK recvfrom returns WB- -> WK close WB# WK# SK# DS#
Sequence Diagram Example: A Comments and Frames
Original syntax and explanations: http://www.spinellis.gr/sw/umlgraph/doc/gui-db.html
Alternate syntax:
A * #Actor G : g:GUI SPACER : D : #db:DB G+ G :> D db:DB D! D //[C1,down 1 right .25] waiting for \n condition \n dbMailbox A ?-> G openBrowser G ?-> D+ query() G <-? D- result D //[C1] A ?-> G scroll G ?-> D+ query() G <-? D- result D //[C1] A ?-> G Exit : Frame [ G OnExit G- ?-> D+ shutdown() G //[,down .2 right .25] wait for cond. dbShutdown : D // all queries preceeding the \n\ shutdown in the mailbox \n\ are answered already. \n\ DbQuery-Objects can \n\ be destroyed G+ <-? D- done G #> D : D ] Frame : G-