A Sequence Diagram is a type of UML (Unified Modeling Language) diagram that shows how different parts of a system (called objects) interact with each other — step by step, over time.
Think of it like a comic strip for your software — showing:
Who talks to whom?
In what order?
What messages are ...
A Sequence Diagram is a type of UML (Unified Modeling Language) diagram that shows how different parts of a system (called objects) interact with each other — step by step, over time.
Think of it like a comic strip for your software — showing:
Who talks to whom?
In what order?
What messages are sent?
Size: 399.73 KB
Language: en
Added: Oct 08, 2025
Slides: 17 pages
Slide Content
UML Sequence Diagram
Prepared by:
Asst. Prof. Nikul Zinzuvadiya
What is a Sequence Diagram?
A Sequence Diagram is a type of UML (Unified Modeling Language) diagram that shows how different
parts of a system (called objects) interact with each other — step by step, over time.
Think of it like a comic strip for your software — showing:
●Who talks to whom?
●In what order?
●What messages are sent?
Why is it called a "Sequence" Diagram?
Because it shows things in sequence — one action after another — just like a queue. It’s great for
showing the flow of operations in a system.
Sequence Diagram Notation:
1. Actor
●An Actor is someone or something outside the system that interacts with it.
●It can be a human user, another system, or an external device.
●Actor is not part of the system — it only communicates with it.
●Actor can start an interaction (like sending a message or clicking a button).
●It is shown as a stick figure in UML diagrams.
For example:
Here the user in seat reservation system is shown as an actor where it exists outside the system and is
not a part of the system.
2. Lifeline
A Lifeline shows an object inside the system and its life during the interaction.
It tells us:
●Who is involved in the sequence (from inside the system)
●How long they exist during the interaction
Format of a Lifeline:
Instance Name : Class Name
Actor = person using the system
Lifeline = part of the system doing something
3.Message:
●Communication between objects is depicted using messages. The messages appear in a sequential
order on the lifeline.
●We represent messages using arrows.
●Different types of messages.
1. Synchronous messages
●It means “wait for the reply”
●Sender pauses until receiver finishes work
●Only after getting a reply, the sender continues
●Key Idea: You cannot move ahead without the reply
2. Asynchronous Messages
●It means “don’t wait for the reply”
●Sender does not pause – it keeps moving forward
●Receiver may finish later, but sender doesn’t wait
●Key Idea: You can move ahead without the reply
3. Create message
●A Create Message is used to make a new object in a sequence diagram
●When a message call needs a new object, we show it with a create message
●Represented by a dotted arrow (---→)
●Labeled with the word “create”
●Points to the new object’s lifeline
●On an e-commerce website:
●When a customer places an order
●A new Order object is created
●This action is shown with a Create Message
4. Delete Message
●A Delete Message is used to remove or destroy an object
●Means the object is no longer needed, and its memory is freed
●After this, the object’s lifeline ends
●Represented by an arrow ending with an “X” ( ❌ )
●Marks the point where the object is destroyed
●In an e-commerce website:
●When an order is delivered/received by the customer
●The Order object can be destroyed (no longer needed in memory)
5. Self Message
●Sometimes, an object needs to send a message to itself
●This is called a Self Message
●It shows the object is performing some internal operation
●Device accessing its own webcam
●Device object sends a message to itself: “openWebcam()”
6. Reply Message
●A Reply Message shows the response sent back from the receiver to the sender
●It indicates that the receiver has finished processing
●The interaction moves forward only after the reply is sent
●A device requests a photo from the user
●The user sends back the photo ??????
●That photo being sent is shown as a Reply Message
7. Found Message
●A Found Message represents a message that comes from an unknown source
●We know the message was received, but we don’t know who sent it
●Hardware failure in a device ??????⚡
●Failure could be due to multiple unknown reasons.
●Since the exact sender is not known, it’s shown as a Found Message.
8.Lost Message
●A Lost Message is when the recipient is not known
●We know the message was sent, but we don’t know where it will go
●A warning is generated ⚠
●It may be meant for the user or some other software/object.
●Since the exact receiver is unknown beforehand, we show it as a Lost Message.
9.Guards
●Guards are conditions written in UML diagrams
●They control the flow of messages or actions
●The message happens only if the condition is true
●To restrict or allow actions based on conditions
●Helps developers understand the constraints in a system
●Ensures processes are valid and logical
●ATM Withdrawal ??????
○Condition: Balance > 0
○Only if balance is greater than zero → Cash is withdrawn
○If balance ≤ 0 → Cash cannot be withdrawn
sequence diagram for an emotion based music player
●Firstly the application is opened by the user.
●The device then gets access to the web cam.
●The webcam captures the image of the user.
●The device uses algorithms to detect the face and predict the mood.
●It then requests database for dictionary of possible moods.
●The mood is retrieved from the database.
●The mood is displayed to the user.
●The music is requested from the database.
●The playlist is generated and finally shown to the user.