2. Presentation Outline
Introduction
What is UML?
Types of UML.
What is Sequence Diagram
Significance Of Sequence
Diagram
Use Of Sequence Diagram
Sequence Diagram Notation
Lifeline Notation
Activation Burs
Message Arrows
Comment
Types of Message
Message Example
Sequence Fragments
Sequence Fragments
Example
Steps for building sequence
diagram
Example
Open Problem
Conclusion
Reference
2
3. Introduction
What is UML?
• UML , short for Unified Modeling Language, is a standardized
modeling language consisting of an integrated set of diagrams,
developed to help system and software developers for specifying,
visualizing, constructing, and documenting the artifacts of software
systems, as well as for business modeling and other non-software
systems.
Types of UML Diagrams –
• Use case Diagram
• Class Diagram
• Activity Diagram
• Sequence Diagram
• State Diagram
• Deployment Diagram
•
3
4. What Is Sequence Diagram ?
• Sequence diagrams describe interactions among classes in terms of an
exchange of messages over time.[1]
• They're also called event diagrams.
• A sequence diagram is a good way to visualize and validate various
runtime scenarios.
• They illustrate how the different parts of a system interact with each
other to carry out a function, and the order in which the interactions
occur when a particular use case is executed.[2]
• In simpler words, a sequence diagram shows different parts of a
system work in a ‘sequence’ to get something done.[2]
4
5. Significance Of Sequence Diagram
• An organization's technical staff can find sequence diagrams useful in
documenting how a future system should behave.[4]
• During the design phase, architects and developers can use the diagram to
force out the system's object interactions, thus fleshing out overall
system design.[4]
5
6. Use Of Sequence Diagram
• One of the primary uses of sequence diagrams is in the transition from
requirements expressed as use cases to the next level of refinement.
[4]
• Use cases are often refined into one or more sequence diagrams.
• In addition to their use in designing new systems, sequence diagrams
can be used to document how objects in an existing system currently
interact.[4]
• This documentation is very useful when transitioning a system to
another person or organization.
6
7. Sequence Diagram Notation
• A sequence diagram is structured in such a way that it represents a
timeline which begins at the top and descends gradually to mark the
sequence of interactions.[2]
• Each object has a column and the messages exchanged between them
are represented by arrows.[2]
• Lifeline Notation
• Activation Burs
• Message Arrows
• Comment
7
8. Lifeline Notation
• A sequence diagram is made up of several of these lifeline
notations that should be arranged horizontally across the top
of the diagram.[2]
• No two lifeline notations should overlap each other.[2]
• They represent the different objects or parts that interact
with each other in the system during the sequence.[2]
8
9. Lifeline Notation
oActor
• A lifeline notation with an actor element symbol is used when
the particular sequence diagram is owned by a use case.[2]
• Represent roles played by human user, external hardware ,or
other subject.
9
10. Lifeline Notation
o Entity
• A lifeline with an entity element represents system data.
• In a customer service application, the Customer entity
would manage all data related to a customer.[2]
10
11. Lifeline Notation
oBoundary
• A lifeline with a boundary element indicates a software element in a system.
• user interface screens, database gateways or menus that users interact with, are
boundaries.[2]
11
12. Activation Bars
• Activation boxes represent the time an object needs to complete a task.[1]
• When an object is busy executing a process or waiting for a reply message, use a
thin gray rectangle placed vertically on its lifeline.[1]
12
13. Message
• Messages are arrows that represent communication between objects.
• A message can flow in any direction; from left to right, right to left or
back to the Message Caller itself.[2]
• The message arrow comes with a description, which is known as a
message signature, on it. The format for this message signature is
below.[2]
• attribute = message_name (arguments): return_type .
13
15. Types Of Message
Call Message
• Call message is a kind of message that
represents an invocation of operation of
target lifeline.[3]
Return Message
• Return message is a kind of message
that represents the pass of information
back to the caller of a corresponded
former message.[3]
15
16. Types Of Message
Self Message
• Self message is a kind of message that
represents the invocation of message of
the same lifeline.[3]
Recursive Message
• Recursive message is a kind of message
that represents the invocation of
message of the same lifeline.
• It's target points to an activation on top
of the activation where the message was
invoked from.[3]
16
17. Types Of Message
Create Message
• Create message is a kind of message that
represents the instantiation of (target)
lifeline.[3]
Destroy Message
• Destroy message is a kind of message
that represents the request of
destroying the lifecycle of target
lifeline.[3]
17
18. Types Of Message
Duration Message
• Duration message shows the distance
between two time instants for a message
invocation.[3]
18
20. Comment
• The comment object is a rectangle with a folded-over corner as shown below.
• The comment can be linked to the related object with a dashed line.[2]
• A comment (note) gives the ability to attach various remarks to elements.[3]
20
22. Sequence Fragments
• Sequence fragments make it
easier to create and maintain
accurate sequence diagrams.
• A sequence fragment is
represented as a box, called
a combined fragment, which
encloses a portion of the
interactions within a
sequence diagram.[4]
o The fragments available are[4]:
• alt- Alternative fragment
models if…then…else
constructs. Only one
sequence occurs on any
occasion.
22
23. Sequence Fragments
• opt- Optional. Encloses a
sequence that might or might not
happen. You can specify, in the
guard, the condition under which
it occurs.[4]
• loop - Loop fragment encloses a
series of messages which are
repeated.[4]
• Loop combined fragments have
the properties Min and Max,
which indicate the minimum and
maximum number of times that
the fragment can be repeated.
23
24. Sequence Fragments
• ignore - Ignore fragment declares a message or message to
be of no interest if it appears in the current context.[4]
• Par- Parallel fragment denotes concurrent processing.[4]
24
26. Steps For Building A Sequence Diagram
1. Set the context .
2. Identify which objects and actors will participate.
3. Set the lifeline for each object/actor .
4. Lay out the messages from the top to the bottom of the diagram based on
the order in which they are sent .
5. Add the focus of control for each object’s or actor’s lifeline .
6. Validate the sequence diagram.
26
32. Open Problem -1
Draw a sequence diagram that can detect the user's emotion by
his/her face and show the music playlist on based his/her emotion.
32
33. Open Problem - 2
• Technology has completely transformed the field of medicine, as it has with most
industries. A hospital information system, also known as a hospital information
system, helps doctors, administrators, and hospital staff managing all of the
activities and information collected at a hospital, including checkups, prescriptions,
appointments, and information on the patients and their caretakers.
• Draw the Sequence diagram on a Hospital Management System.
33
35. Conclusion
The sequence diagram is a good diagram to use to document a system’s requirements
and to flush out a system’s design. The reason the sequence diagram is so useful is
because it shows the interaction logic between the objects in the system in the time
order that the interactions take place.
35