### Sequence Diagram Summary

```Concepts & Notations
Acknowledgements

The material in this tutorial is
based in part on:
 The Unified Modeling Language
Reference Manual, 2nd edition, by
James Rumbaugh, Ivar Jacobson,
Interaction View
 Interaction Diagram
 Sequence Diagram
 Examples

Interaction View

Objects interact to implement behavior

Two ways to describe interaction
 focus on individual objects (state machine)
 focus on interactions of a collection of
cooperating objects (interaction view)

Provides a more holistic view of the
behavior of a set of objects
Interaction Diagram

Collaboration Diagram
 Emphasizes structural relations between
objects

Sequence Diagram
 Illustrates how objects interacts with each
other
 Emphasizes time ordering of messages
Sequence Diagram
member:
LibraryMember
book:Book
:Book
Copy
borrow(book)
ok = mayBorrow()
[ok] borrow(member)
setTaken(member)
Sequence Diagram
X-Axis (roles)
member:
LibraryMember
book:Book
:Book
Copy
borrow(book)
Y-Axis (time)
ok = mayBorrow()
[ok] borrow(member)
setTaken(member)
Sequence Diagram
X-Axis (roles)
member:
LibraryMember
book:Book
:Book
Copy
symbol
borrow(book)
Y-Axis (time)
ok = mayBorrow()
[ok] borrow(member)
setTaken(member)
life line
Sequence Diagram
X-Axis (roles)
member:
LibraryMember
book:Book
:Book
Copy
symbol
borrow(book)
Y-Axis (time)
ok = mayBorrow()
activation
double line
[ok] borrow(member)
setTaken(member)
life line
Object

Naming
 syntax
 [instance Name]:[class Name]

Life line
 represents the object’s life during the
interaction
bDay:Date
Object

Active Object
 holds the root of a stack executions
 has its own thread of control

Passive Object
 objects that are called by an active object
 receive control only when called
Object
active object
passive object
active object
actor1 : …
: Queue
actor2 : …
pull
pull
Message

An interaction between two objects
 operation call
 signaling
 RPC

An arrow between the life lines of two objects

Labeled with
 name
 arguments
 control information
Message
actor1 : …
actor2 : …
: Queue
pull
pull
message
message
Synchronous Message

The routine that handles the message is
completed before the caller resumes
execution
synchronous
message
:A
:B
doYouUnderstand()
Caller
Blocked
yes
return
(optional)
Creation Message

An object may create another object via
a create() message
create
message
Preferred
old:A
create()
:B
Destruction Message

An object may destroy another object
via a destroy() message
old:A
destroy()
new:B
Examples
:PrintServer
:Queue
Client
print(doc,client)
Repeated forever
with 1 min
interludes
[job] done(status)
enqueue(job)
job=dequeue()
[job]print(job.doc)
status
:Printer
Proxy
Examples
:PrintServer
:Queue
Client
print(doc,client)
Repeated forever
with 1 min
interludes
[job] done(status)
enqueue(job)
job=dequeue()
[job]print(job.doc)
status
:Printer
Proxy
Examples
:PrintServer
:Queue
Client
print(doc,client)
Repeated forever
with 1 min
interludes
[job] done(status)
enqueue(job)
job=dequeue()
[job]print(job.doc)
status
:Printer
Proxy
Examples
:PrintServer
:Queue
Client
print(doc,client)
Repeated forever
with 1 min
interludes
[job] done(status)
enqueue(job)
job=dequeue()
[job]print(job.doc)
status
:Printer
Proxy
Examples
:PrintServer
:Queue
Client
print(doc,client)
Repeated forever
with 1 min
interludes
[job] done(status)
enqueue(job)
job=dequeue()
[job]print(job.doc)
status
:Printer
Proxy
Examples
:PrintServer
:Queue
Client
print(doc,client)
Repeated forever
with 1 min
interludes
[job] done(status)
enqueue(job)
job=dequeue()
[job]print(job.doc)
status
:Printer
Proxy
Examples
:PrintServer
:Queue
Client
print(doc,client)
Repeated forever
with 1 min
interludes
[job] done(status)
enqueue(job)
job=dequeue()
[job]print(job.doc)
status
:Printer
Proxy
Review
Time on y-axis, roles on x-axis
 Activation bars represent executions of
procedures
:PrintServer
 Active objects have bars
 Dashed message lines: return

```