You are on page 1of 31

Object Oriented Analysis

and Design
Construction Phase
DESING (Sequence Diagram)
Compiled and Presented By:
Muhammad Imran Saeed,
Assistant Professor,
DCS&SE,
© 2020 Muhammad Imran Saeed. This International Islamic University, Islamabad.
Lecture is available free for non-commercial
use with attribution.
Object Oriented
Analysis and Design
Disclaimer and Acknowledgement
These Class notes/lectures have been COMPILED to
help students for online Classes (due to Covid’19
Epidemic) from different books and resources available
on internet.
So I personally acknowledge all the authors, teachers,
presenters, publishers and other organizations etc.
This Compilation work is soul Intellectual Property of Undersigned.
© 2020 Muhammad Imran Saeed. This Lecture is available free for non-commercial use with attribution.
Object Oriented
Analysis and Design
Textbook Followed in this Series of Lectures

-OOAD with UML: Object Oriented Analysis and Design


Using the UML.
-Other Resources from Internet.

© 2020 Muhammad Imran Saeed. This Lecture is available free for non-commercial use with attribution.
Object Oriented
Analysis and Design

UML (Unified Modeling Language)Diagrams


SEQUENCE DIAGRAM
Object Oriented
Analysis and Design

What is SEQUENCE
DIAGRAM?
Object Oriented
Analysis and Design
What is SEQUENCE DIAGRAM?
• Sequence diagrams model the interactions between
objects in a single use case.
• 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.
Object Oriented
Analysis and Design
What is SEQUENCE DIAGRAM? Cont..
• In simpler words, a sequence diagram shows
different parts of a system work in a ‘sequence’ to
get something done.
• Sequence Diagrams are time focus and they show
the order of the interaction visually by using the
vertical axis of the diagram to represent time what
messages are sent and when.
Object Oriented
Analysis and Design

Purpose of Sequence Diagram


● High-level interaction between active objects in a system
● The interaction between object instances within a
collaboration that realizes a use case
● The interaction between objects within a collaboration
that realizes an operation
Object Oriented
Analysis and Design
Notation / Visual Representation / Symbols
Lifeline
• A sequence diagram is made up of
several of these lifeline notations that
should be arranged horizontally across
the top of the diagram.
Object Oriented
Analysis and Design
Notation / Visual Representation / Symbols
Lifeline (Cont..)
• No two lifeline notations should overlap each
other.
• They represent the different objects or parts that
interact with each other in the system during the
sequence.
• A lifeline represents an individual participant in
the Interaction.
Object Oriented
Analysis and Design
Notation / Visual Representation / Symbols

Actor
● A lifeline notation with an actor element symbol
is used when the particular sequence diagram is
owned by a use case.
● Represent roles played by human users, external
hardware, or other subjects.
Object Oriented
Analysis and Design
Notation / Visual Representation / Symbols
Actor
● A lifeline notation with an actor element symbol
is used when the particular sequence diagram is
owned by a use case.
● Represent roles played by human users, external
hardware, or other subjects.
Object Oriented
Analysis and Design
Notation / Visual Representation / Symbols
Entity Element
● A lifeline with an entity element represents
system data.
● For example, in a customer service application,
the Customer entity would manage all data
related to a customer.
Object Oriented
Analysis and Design
Notation / Visual Representation / Symbols
Control Element
● And a lifeline with a control element indicates a
controlling entity or manager.
● It organizes and schedules the interactions
between the boundaries and entities and serves
as the mediator between them.
Object Oriented
Analysis and Design
Notation / Visual Representation / Symbols
Activation Bars
● A thin rectangle on a lifeline) represents the
period during which an element is performing
an operation.
● The top and the bottom of the of the
rectangle are aligned with the initiation and
the completion time respectively.
Object Oriented
Analysis and Design
Notation / Visual Representation / Symbols
Activation Bars (Cont..)
Object Oriented
Analysis and Design
Notation / Visual Representation / Symbols
Message Arrows
● An arrow from the Message Caller to the
Message Receiver specifies a message in a
sequence diagram.
● A message can flow in any direction; from
left to right, right to left or back to the
Message Caller itself.
Object Oriented
Analysis and Design
Notation / Visual Representation / Symbols
Message Arrows (Cont..)
● While you can describe the message being
sent from one object to the other on the
arrow, with different arrowheads you can
indicate the type of message being sent or
received.
Object Oriented
Analysis and Design
Notation / Visual Representation / Symbols
(Synchronous) Message Arrows (Cont..)
● A synchronous message is used when the sender waits for
the receiver to process the message and return before
carrying on with another message.
● The arrowhead used to indicate this type of message is a
solid one, like the one below.
Object Oriented
Analysis and Design
Notation / Visual Representation / Symbols
(Asynchronous) Message Arrows (Cont..)
● An asynchronous message is used when the message caller does
not wait for the receiver to process the message and return
before sending other messages to other objects within the
system.
● The arrowhead used to show this type of message is a line arrow
(Simple Arrowhead).
Object Oriented
Analysis and Design
Notation / Visual Representation / Symbols
Message Arrows (Example)
Object Oriented
Analysis and Design
Notation / Visual Representation / Symbols
Call Message
● A message defines a particular
communication between Lifelines of
an Interaction.
● Call message is a kind of message
that represents an invocation of
operation of target lifeline.
Object Oriented
Analysis and Design
Notation / Visual Representation / Symbols
Return Message
● A return message is used to indicate that the message
receiver is done processing the message and is returning
control over to the message caller.
● Return messages are optional notation pieces, for an
activation bar that is triggered by a synchronous message
always implies a return message.
Object Oriented
Analysis and Design
Notation / Visual Representation / Symbols
Return Message (Cont..)
Object Oriented
Analysis and Design
Notation / Visual Representation / Symbols
Return Message (Cont..)
Object Oriented
Analysis and Design
EXAMPLE from Book:
Object Oriented
Analysis and Design
EXAMPLE of an ATM:
Object Oriented
Analysis and Design
EXAMPLE of an ATM:
Object Oriented
Analysis and Design
EXAMPLE of an ATM:
Object Oriented
Analysis and Design
READING ASSIGNMENT:

ADVANTAGES DISADVANTAGES
• It help you discover architectural, interface ● Sequence diagrams can become complex
and logic problems early. when too many lifelines are involved in the
• A valuable collaboration tools during design system.
meetings because they allow you to discuss ● If the order of message sequence is changed,
the design in concrete terms.
then incorrect results are produced.
• It can be used to document the dynamic view
of the system design at various levels of ● Each sequence needs to be represented
abstraction, which is often difficult to extract using different message notation, which can
from static diagrams or even the complete be a little complex.
source code.
Advice

Along with this presentation also study from book and


consider different case studies from different websites
to prepare for real life practices.

THANK YOU

© 2020 Muhammad Imran Saeed. This Video/presentation is available free for non-commercial use with attribution.

You might also like