UML Sequence diagram
Sequence Diagram(make a
phone call)
Caller Phone Recipient
Picks up
Dial tone
Dial
Ring notification Ring
Picks up
Hello
1. Person kicks the cat
2. Cat reports to inspector
3. Inspector reports to Policeman
4. Policeman arrests person
Slide 3
Slide 4
Slide 5
Sequence Diagrams
• Dynamic model
• Illustrate the objects that participate in a use-case
• Show the sequence of messages that pass between objects
for a particular use-case over time
• Example: order food, change tv channel
• It models a single scenario executing in the system
Slide 6
Sequence Diagrams – Object Life Spans
• Creation
A
⮚ Create message
⮚ Object life starts at that point
• Activation Create
B
⮚ Symbolized by rectangular stripes
⮚ Place on the lifeline where object is
activated.
⮚ Rectangle also denotes when object
is deactivated.
• Deletion X
Activation bar Return
⮚ Placing an ‘X’ on lifeline
Deletion
⮚ Object’s life ends at that point
Lifeline
Sequence Diagram
• Sequence diagrams demonstrate
the behavior of objects in a use case Message
by describing the objects and the
messages they pass.
• The horizontal dimension shows the
objects participating in the
interaction.
• The vertical arrangement of
messages indicates their order.
• The labels may contain the seq. #
to indicate concurrency.
Sequence Diagram for Patient appointment
Use Case
Slide 10
Sequence Diagram for Print Invoice
use case
Example: Use Case Diagram of the
Vending Machine
Sequence Diagram
for Deposit Money Use Case
System Sequence Diagram
for Make Selection Use Case
System Sequence Diagram
for Cancellation Use Case
System Sequence Diagram
for Update Database Use Case
Building a Sequence Diagram
1. Determine the context of the sequence diagram
2. Identify the participating objects
3. Set the lifeline for each object
4. Add messages
5. Add execution occurrence on each object’s
lifeline
6. Validate the sequence diagram
Slide 17
Alternate / if-else scenario in sequence
diagram
Upper or lower
part will work
at a time.
Based on the
condition.
Sequence Diagram for search book
Use Case
Multiple If-else condition
Slide 21
Thanks
* 22