0% found this document useful (0 votes)
15 views

Software Engg Week 9 Activity-Sequence Diagram

Uploaded by

wwwchaudry1
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views

Software Engg Week 9 Activity-Sequence Diagram

Uploaded by

wwwchaudry1
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 24

UML Diagrams

LECTURE
Activity Diagrams

 It is a behavioral diagram that illustrates the flow of activities


through a system.
 Activity diagram is basically a flowchart to represent the flow
from one activity to another activity.
 The activity can be described as an operation of the system.
 The control flow is drawn from one operation to another. This
flow can be sequential, branched, or concurrent.
 Activity diagrams deal with all type of flow control by using
different elements such as fork, join, etc
Activity Diagrams

When to Use:
 The main reason to use activity diagrams is to model the
workflow behind the system being designed.
 Activity Diagrams are also useful for: analyzing a use case by
describing what actions need to take place and when they
should occur;
 Activity diagrams do not give detail about how objects behave
or how objects collaborate.
Activity diagrams -
Notations
Activity Activity states - Represent the performance of a step within
the workflow.

Transition show what activity state follows after another.

Decisions (branch) for which a set of guard conditions are


defined. These are conditions that must be met to trigger the
transition.

Synchronization bars - which you can use to show parallel


sub-flows. Synchronization bars allow you to show concurrent
threads - fork node or join node.
Rules
Activity diagrams show the flow of activities through the system.
Diagrams are read from top to bottom and have branches and forks to describe conditions and
parallel activities.
A fork is used when multiple activities are occurring at the same time.
The branch describes what activities will take place based on a set of conditions.
 All branches at some point are followed by a merge to indicate the end of the conditional
behavior started by that branch.
After the merge all of the parallel activities must be combined by a join before transitioning into
the final activity state.
How to Draw Activity
diagrams
Step 1: Figure out the action steps from the use case
Here you need to identify the various various activities and actions your business process or and actions your
business process or system is made up of is made up of.
Step 2: Identify the actors who Step 2: Identify the actors who are involved
If you already have figured out who the actors are, then it’s easier figured out who the actors are, then it’s
easier to discern each action they are responsible for discern each action they are responsible for.
Step 3: Find a flow among the Step 3: Find a flow among the activities
Figure out in which order the actions are processed. Mark down the conditions that have to be met in order to
carry out certain processes, which actions occur processed. Mark down the conditions that have to be met in
order to carry out certain processes, which actions occur at the same time and whether you need to add any
branches in the diagram and whether you need to add any branches in the diagram.
Step 4: Add swimlanes
You have already figured out who is responsible for each action You have already figured out who is responsible
for each action. Now it’s time to assign them Now it’s time to assign them a swimlane and group each action
they are responsible for under them swimlane and group each action they are responsible for under them.
How to Draw Activity
diagrams
Activity Diagram
Draw activity diagram with the four main activities:
• Send order by the customer
• Receipt of the order
• Confirm order
• Dispatch order
After receiving the order request condition checks are performed to check if it is normal or
special order.
After the type of order is identified dispatch activity is performed and that is marked as the
termination of the process.
User Bank

ATM Activity Diagram


(Swimlane)
Sequence diagrams
(Interaction Diagram)
Sequence diagrams, commonly used by developers, model the interactions between objects in a
single use case.
In simpler words, a sequence diagram shows different parts of a system work in a ‘sequence’ to
get something done.
Sequence diagrams describe interactions among objects in terms of an exchange of messages
over time.
Sequence diagrams show a detailed flow for a specific use case or even just part of a specific use
case.
The main purpose of a sequence diagram is to define event sequences that result in some
desired outcome.
The focus is on the order in which messages occur.
Elements of Sequence
diagrams
Life lines

Send Receive
Messages

Objects
Life Line
A sequence diagram is made up of several of these lifeline notations that should be
arranged horizontally across the top of the diagram.
Object
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 notation with an actor element symbol is used when the particular sequence
diagram is owned by a use case.
Activation
Bars The length of the rectangle indicates the duration of the
objects staying active.
Activation bar is the box In a sequence diagram, an interaction between two objects
placed on the lifeline. occurs when one object sends a message to another.
It is used to indicate that The use of the activation bar on the lifelines of the Message
an object is active (or Caller (the object that sends the message) and the Message
instantiated) during an Receiver (the object that receives the message) indicates that
both are active/is instantiated during the exchange of the
interaction between two message.
objects.
Message
Arrows While you can describe the message being sent from one object to
the other on the arrow, with different arrowheads you can indicate
 An arrow from the Message the type of message being sent or received.
Caller to the Message Receiver
specifies a message in a Return Messages
sequence diagram.
 A return message is used to indicate that the message receiver is
 A message can flow in any done processing the message and is returning control over to the
direction; from left to right, message caller.
right to left or back to the
Message Caller itself.  Return messages are optional notation pieces, for an activation bar
that is triggered by a synchronous message always implies a return
 The message arrow comes message.
with a description, which is
known as a message
signature, on it.
The format for this message
signature is below.
message_name (arguments):returntype  Tip: You can avoid cluttering
up your diagrams by
 All parts are optional except the minimizing the use of return
message_name . messages
Reflexive Message Destruction Message
 When an object sends a Participants when no longer needed can also be deleted
message to itself, it is from a sequence diagram.
called a reflexive message. This is done by adding an ‘X’ at the end of the lifeline of
 It is indicated with a the said participant.
message arrow that starts
and ends at the same
lifeline as shown in the
example below.
How to draw Sequence Diagram
 Focus on the use case named ‘Create New User
Account’ to draw our sequence diagram from
given use case diagram.
 Before drawing the sequence diagram, it’s
necessary to identify the objects or actors that
would be involved in creating a new user
account. These would be:
• Librarian
• Online Library Management system
• User credentials database
• Email system
 Once you identify the objects, it is then important to
write a detailed description on what the use case
does.
 From this description, you can easily figure out the
interactions (that should go in the sequence diagram)
that would occur between the objects above, once
the use case is executed.
Steps to create new From each of these steps, you can easily specify what messages should
library User Account be exchanged between the objects in the sequence diagram.
 The librarian request the system
to create a new online library
account
 The librarian then selects the
library user account type
 The librarian enters the user’s
details
 The user’s details are checked
using the user Credentials
Database
 The new library user account is
created
 A summary of the of the new
account’s details are then emailed
to the user
Reference
https://youtu.be/IFqhoJJ3q8A

You might also like