SE Unit 4.4
SE Unit 4.4
Unit 4
Requirement Analysis and
Specification
Analysis Models Part 4
Sequence Diagram
Sequence Diagram
A Sequence diagram shows the participants (Objects) in an interaction and the sequence of
message among them.
A sequence diagram shows the interaction of a system with its actors to perform all or part of
a use case.
Sequence diagram represent the dynamic communication between object during execution of
task.
Each use case requires one or more sequence diagram to describe its behavior.
Each sequence diagram shows a particular behavior sequence of the use case.
It is best to show a specific portion of a use case and not attempt to be too general.
You can draw a separate sequence diagram for each task.
Components of Sequence Diagram
Object - Class Roles or Object : Class
Participants
Class roles describe the way an object will behave in context.
Use the UML object symbol to illustrate class roles, but don't list object attributes.
Activation or Execution
Occurrence
Activation boxes represent the time an object needs to complete a task.
When an object is busy executing a process or waiting for a reply message, use
a thin gray rectangle placed vertically on its lifeline.
Lifeline
A lifeline represents a Object in an interaction.
When that object's lifeline ends, you can place an X at the end of its lifeline to
X
denote a destruction occurrence.
Components of Sequence Diagram Cont.
Messages
Messages are arrows that represent communication between objects.
Use the following arrows and message symbols to show how information is transmitted
between objects.
Synchronous message
Represented by a solid line with a solid arrowhead.
This symbol is used when a sender must wait for a response to a message before it continues.
The diagram should show both the call and the reply.
Asynchronous message
Represented by a solid line with a lined arrowhead.
Asynchronous messages don't require a response before the sender continues.
Only the call should be included in the diagram.
Components of Sequence Diagram Cont.
Reply message
Represented by a dashed line with a lined arrowhead.
these messages are replies to calls.
Delete message X
Represented by a solid line with a solid arrowhead, followed by an X.
This message destroys an object.
Guideline for Sequence Diagram
Prepare at least one scenario per use case Abstract the scenarios into sequence diagrams.
The steps in the scenario should be The sequence diagrams clearly show the
logical commands, not individual button contribution of each actor.
clicks.
It is important to separate the contribution of
You can specify the exact syntax of each actor as a prelude to organizing
input. behavior about objects.
Start with the simplest mainline
interaction - no repetitions, one main Divide complex interactions
activity, and typical values for all Break large interactions into their
parameters. constituent tasks and prepare a sequence
If there are substantially different diagram for each of them.
mainline interactions, write a scenario
for each.
Prepare a sequence diagram for each error condition.
Show the system response to the error condition.
Steps to Draw a Sequence Diagram
Step-1 Select one scenario
Step-2 Identify the necessary set of the objects. Who is taking part ?
Step-3 Identify the necessary interactions/steps.
Step-4 Describe the message exchange between object.
Step-5 Identify the sequence of interactions and who starts Interactions.
Example: Sequence Diagram for Book Issue
Book issue is a one business process or a function in Library Management System.
Necessary objects for book issue process are Librarian, Book, Member and Transaction .
Member class object starts the interaction.
Various interactions in book issue process are