Lecture-Activity Diagrams
Lecture-Activity Diagrams
10/19/22 1
Today’s Agenda
10/19/22 OOAD 2
Agate Case Study
Agate is an advertising agency in Birmingham. Agate
deals with other companies that it calls clients. A record is
kept of each client company. Clients have advertising
campaign, and a record is kept of every campaign. Each
campaign includes one or more adverts. Agate nominates
members of creative team, which work on campaign.
One member of the creative team manages each
campaign. Staff may be working on more than one project
at a time. When a campaign starts, the manager responsible
estimates the likely cost of the client and agrees it with the
client. A finish date may be set for a campaign at any time,
and may be changed. When the campaign is completed, an
actual completion date and the actual cost are recorded.
When the client pays, the date paid is recorded. The
manager checks the campaign budget periodically.
10/19/22 The system should also hold the staff grades and 3
calculate staff salaries.
Sample Requirements List
No. Requirement Use Case(s)
1. To record names, address and contact Add a new client
details for each client.
2. To record the details of each campaign for Add a new campaign
each client. This will include the title of the
campaign, planned start and finish dates,
estimated costs, budgets, actual costs and
dates, and the current state of completion.
3. To provide information that can be used in Record completion of
the separate accounts systems for invoicing a campaign
clients for campaigns.
4. To record payments for campaign that are Record client
also recorded in the separate accounts payment
system.
5. To record which staff are working on which Assign staff to work
campaigns, including the campaign manager on a campaign
for each campaign.
10/19/22 4
10/19/22 5
SSD and Use Cases
:System
:Cashier
makeNewSale()
mple cash-only Process Sale Scenario
addLineItem(itemID, quantity)
Customer arrives at a POS checkout
with goods to purchase.
Cashier starts a new sale. description, total
Cashier enters item identifier. *[more items]
System records sale line item, and
presents item description, price and endSale()
unning total.
cashier repeats steps 3-4 until total with taxes
ndicates done.
System presents total with taxes makePayment(amount)
calculated.
change due, receipt
10/19/22 6
System sequence diagrams [1]
A system sequence diagram illustrates events from actors to
systems and the external response of the system
10/19/22 7
System sequence diagrams [2]
10/19/22 8
System sequence diagram [3]
Identify the system boundary…what is inside and what is outside.
Name an event at the level of intent and not using their physical
input medium or interface widgets.
enterItem() is better than scan().
[Larman, 2002]
10/19/22 10
Activity Diagrams
Purpose
to model a task (for example in business modelling)
to describe a function of a system represented by a
use case
to describe the logic of an operation
to model the activities that make up the life cycle in
the Unified Process
Model dynamic behavior of a system as a flowchart.
Description of a business process, by activities and
their I/O.
10/19/22 11
Drawing Activity Diagrams
Purpose
Draw the activity flow of a system. Activity can be
described as an operation of the system.
Describe the sequence from one activity to
another.
Describe the parallel, branched and concurrent
flow of the system.
Captures dynamic behavior of the system as like
other behavioral diagrams but activity diagram
show message flow from one activity to another.
10/19/22 12
UML Activity Diagram
Slide 14
10/19/22
How to draw Activity
Diagram
Before drawing an activity diagram we must have a
clear understanding about the elements used in activity
diagram.
10/19/22 15
Notation of Activity Diagrams
Activities
rectangle with rounded ends Add a New
Client
meaningful name
Assign Staff
Contact
Transitions
arrows with open
arrowheads
10/19/22 16
Notation of Activity Diagrams
Start state Add a New
Client
black circle
Decision points Assign Staff
diamond Contact
10/19/22 17
Notation of Activity Diagrams
Alternative notation for Add a New
Client
10/19/22 18
UML Activity Decision
10/19/22 19
Branching Nodes
Dry Clothes
merge
node Run Drier
[still wet]
decision [else] guards
node Fold
Clothes
10/19/22 20
Notation of Activity Diagrams
Object flows :Campaign
[Active]
dashed arrow
Record completion
Objects of a campaign
rectangle :Campaign
[Completed]
with name of object
underlined
optionally shows the
state of the object in
square brackets
10/19/22 21
Notation of Activity Diagrams
Campaign Accountant Client
Manager
Swimlanes
Record Completion
vertical columns of a campaign
person, organisation
or department Pay invoice
column
10/19/22 22
Notation of Activity Diagrams
Campaign Accountant Client
Manager
Swimlanes
Record Completion
vertical columns of a campaign
person, organisation
or department Pay invoice
column
10/19/22 23
Subset of structural elements
of ADs
10/19/22 24
10/19/22 25
10/19/22 26
Drawing Activity Diagrams
What is the purpose?
This will influence the kind of activities that
are shown
What is being shown in the diagram?
What is the name of the business process,
use case or operation?
What level of detail is required?
Is it high level or more detailed?
10/19/22 27
Drawing Activity Diagrams
Identify activities
What happens when a new client is added
in the Agate system?
Add a New Client
Assign Staff Contact
Add New Campaign
Assign Staff to Campaign
Organise the activities in order with
transitions
10/19/22 28
Drawing Activity
Diagrams Add a New
Client
Assign Staff
Contact
Add New
Campaign
Assign Staff
to Campaign
10/19/22 29
Drawing Activity Diagrams
Identify any alternative transitions and
the conditions on them
sometimes there is a new campaign to add
for a new client, sometimes not
sometimes they will want to assign staff to
the campaign, sometimes not
Add transitions and guard conditions to
the diagram
10/19/22 30
Drawing Activity
Diagrams Add a New
Client
[campaign to add]
[staff to assign]
Assign Staff
to Campaign
10/19/22 31
Drawing Activity Diagrams
Identify any processes that are
repeated
they will want to assign staff to the
campaign until there are no more staff to
add
Add transitions and guard conditions to
the diagram
10/19/22 32
Drawing Activity
Diagrams Add a New
Client
[campaign to add]
[staff to assign]
10/19/22 33
Drawing Activity Diagrams
Are all the activities carried out by the
same person, organisation or
department?
If not, then add swimlanes to show the
responsibilities
Name the swimlanes
Show each activity in the appropriate
swimlane
10/19/22 34
Administrator Campaign Manager
Add a New
Client
[campaign to add]
[staff to assign]
Assign Staff
to Campaign
10/19/22 35
Drawing Activity Diagrams
Are there any object flows and objects
to show?
these can be documents that are created
or updated in a business activity diagram
these can be object instances that change
state in an operation or a use case
Add the object flows and objects
Data and objects are shown as object
10/19/22
nodes 36
Administrator Campaign Manager
[campaign to add]
[staff to assign]
Assign Staff
to Campaign
10/19/22 37
Swimlanes.
office clerk InsuranceAgent Loanofficer
Prepare incoming
documents
Make electronic
file Index documents
Complete
request
Draw up insurance
policy
10/19/22 38