View
214
Download
0
Embed Size (px)
Citation preview
Requirements Analysis 11. 1 Activity Diagrams - 2005b511.ppt
© Copyright De Montfort University 2000All Rights Reserved
INFO2005Requirements Analysis
Activity Diagrams
Department of Information Systems
Requirements Analysis 11. 2 Activity Diagrams - 2005b511.ppt
© Copyright De Montfort University 2000All Rights Reserved
Learning Objectives
Identify the need for activity modelling UML notation for activity diagrams Examine the use of activity diagrams in
the Rational Unified Process.
Requirements Analysis 11. 3 Activity Diagrams - 2005b511.ppt
© Copyright De Montfort University 2000All Rights Reserved
Activity Modelling Computer systems and the commercial /
work environments in which they are used comprise may activities– business activities performed by people
– activities performed with the information system by software
– activities performed by machines under computer control
Requirements Analysis 11. 4 Activity Diagrams - 2005b511.ppt
© Copyright De Montfort University 2000All Rights Reserved
Activity Modelling
Business processes are typically captured in use cases
Computer procedures are embodied in operations (analysis) and the methods (design and construction) that implement them. (Note that objects collaborate to realize a use case).
Requirements Analysis 11. 5 Activity Diagrams - 2005b511.ppt
© Copyright De Montfort University 2000All Rights Reserved
Dynamic Modelling
Activity diagrams are one of the five modelling techniques in UML that capture the dynamics of the system
The others are
Requirements Analysis 11. 6 Activity Diagrams - 2005b511.ppt
© Copyright De Montfort University 2000All Rights Reserved
Activity Diagrams
An activity diagram represents the a series of actions in sequence.
Activity diagrams are essentially flowcharts, rather similar in format to system flowcharts though used in a somewhat different way.
Requirements Analysis 11. 7 Activity Diagrams - 2005b511.ppt
© Copyright De Montfort University 2000All Rights Reserved
Activity Diagram - notation
[campaign found]
Find oldest campaign worked on
[no campaign]
Get campaign bonus level
Get next campaign
Set bonus to grade
minimum
[campaign found]
[no more campaigns]
Average campaign bonus level
Activity diagram for calculateBonus() operation
Bennett, McRobb, Farmer 1999
Requirements Analysis 11. 8 Activity Diagrams - 2005b511.ppt
© Copyright De Montfort University 2000All Rights Reserved
Notation
An action state is normally used to model a step in the execution of an algorithm or procedure
When an action state ends the next action state (depending upon guard conditions) executes.
Requirements Analysis 11. 9 Activity Diagrams - 2005b511.ppt
© Copyright De Montfort University 2000All Rights Reserved
Notation
Transitions show the sequence of the actions. These transitions are completion transitions.
Guard conditions are used represent conditional paths of execution.
Requirements Analysis 11. 10 Activity Diagrams - 2005b511.ppt
© Copyright De Montfort University 2000All Rights Reserved
Notation
A thread of execution with a guard condition is only executed if the condition is satisfied.
Decisions and guard conditions are used to show alternate threads.
Requirements Analysis 11. 11 Activity Diagrams - 2005b511.ppt
© Copyright De Montfort University 2000All Rights Reserved
Activity Diagram - nested decisions
[conditionA]
[conditionB]
[conditionC]
[not conditionA]
[not conditionB]
[not conditionC]
Bennett, McRobb, Farmer 1999
Nested decisions can be used to represent
complex conditions
Requirements Analysis 11. 12 Activity Diagrams - 2005b511.ppt
© Copyright De Montfort University 2000All Rights Reserved
Concurrent threads
Concurrent threads can be shown by using synchronization bars.
A synchronization bar shows the start (fork) or end (join) of a group of parallel subflows.
Requirements Analysis 11. 13 Activity Diagrams - 2005b511.ppt
© Copyright De Montfort University 2000All Rights Reserved
Find cup
Fill kettle with
water
Find tea bag
[milk required] Add water to
cup
Boil water in kettle
Place tea bag
in cup
Add milk
[no milk required]
Bennett, McRobb, Farmer 1999
Requirements Analysis 11. 14 Activity Diagrams - 2005b511.ppt
© Copyright De Montfort University 2000All Rights Reserved
Example: Enrolment
Prepare an activity diagram for student enrolment
Typical activities might be– Prepare registration documentation– Arrange enrolment session– Enrol student at the beginning of the
academic year– Complete enrolment form– Send joining instructions to student
*
Requirements Analysis 11. 15 Activity Diagrams - 2005b511.ppt
© Copyright De Montfort University 2000All Rights Reserved
Requirements Analysis 11. 16 Activity Diagrams - 2005b511.ppt
© Copyright De Montfort University 2000All Rights Reserved
Object flows Object flows are used to show how
objects involved in a workflow, procedure or algorithm.
An object may be the output of an activity and the input activities.
Object flow is a kind of control flow which it replaces.
The object flow symbol shows an object in a particular state.
Requirements Analysis 11. 17 Activity Diagrams - 2005b511.ppt
© Copyright De Montfort University 2000All Rights Reserved
Client Campaign Manager
Campaign Team
Request campaign
Authorize
Pay Run Campaign
Accept Payment
:Campaign [Commissioned]
:Campaign [Active]
:Campaign [Completed]
:Campaign [Paid]
Bennett, McRobb, Farmer 1999
Swimlanes
Object flow
Note that the object changes state
Requirements Analysis 11. 18 Activity Diagrams - 2005b511.ppt
© Copyright De Montfort University 2000All Rights Reserved
Swimlanes
An activity diagram may be partitioned into swimlanes.
Each swimlanes represents a particular responsibility for some of the action states.
The responsibilities may be allocated to a person, a part of an organisation, or a set of classes.
Requirements Analysis 11. 19 Activity Diagrams - 2005b511.ppt
© Copyright De Montfort University 2000All Rights Reserved
Example: Enrolment
Redraw the activity diagram with swimlanes.– possible participants with
responsibilities could be Registry, Faculty and Student.
*
Requirements Analysis 11. 20 Activity Diagrams - 2005b511.ppt
© Copyright De Montfort University 2000All Rights Reserved
Registry Faculty Student
*
Requirements Analysis 11. 21 Activity Diagrams - 2005b511.ppt
© Copyright De Montfort University 2000All Rights Reserved
Where are activity diagrams used? Activity diagrams can be used for a
number of different purposes: to model a human task to describe a system function that is
represented by a use case; to describe the logic of an operation.
Bennett, McRobb, Farmer 1999
Requirements Analysis 11. 22 Activity Diagrams - 2005b511.ppt
© Copyright De Montfort University 2000All Rights Reserved
Activity diagram & BOM
Describes the ordering of activities or tasks that accomplish business goals.
Activity diagrams help
Requirements Analysis 11. 23 Activity Diagrams - 2005b511.ppt
© Copyright De Montfort University 2000All Rights Reserved
Business Use Case Model
A business use case typically involves a workflow that produces some benefit for the business actor.
Activity diagrams are used to describe the structure of workflows
Requirements Analysis 11. 24 Activity Diagrams - 2005b511.ppt
© Copyright De Montfort University 2000All Rights Reserved
Activity diagrams & Use Cases The flow of events of a use case
describes the sequence of activities that together produce the value for an actor.
An activity diagram can be used to describe the flow of events of a use case.
Requirements Analysis 11. 25 Activity Diagrams - 2005b511.ppt
© Copyright De Montfort University 2000All Rights Reserved
Summary
Identify the need for activity modelling UML notation for activity diagrams Examine the use of activity diagrams in
the Rational Unified Process
Requirements Analysis 11. 26 Activity Diagrams - 2005b511.ppt
© Copyright De Montfort University 2000All Rights Reserved
References
Bennett, S. et. al. (2002)“Object-Oriented Systems Analysis & Design using UML” McGraw-Hill, Maidenhead.
OMG (1999) “Unified Modeling Language Specification,version 1.3”
Rational Unified Process 2000