You are on page 1of 19

Lab 5:

Activity Diagram

16-Nov-20 T.A GHADEER AL-HOMYANI 1


Objectives

- Understand the rules and styles guidelines for activity diagram.


- Create functional model using activity diagram.

16-Nov-20 T.A GHADEER AL-HOMYANI 2


What Is an Activity Diagram ?
- Activity diagrams and use cases are logical model which describe the business
domain’s activities without suggesting how they are conduct.

- A diagram that emphasizes the flow of control from activity to activity in an object.

- Similar to the traditional program flowchart.

- Used to provide detail for complex algorithms.

- Represent the primary activities and the relationships among the activities in a
process.

16-Nov-20 T.A GHADEER AL-HOMYANI 3


Elements of an Activity Diagram:

16-Nov-20 T.A GHADEER AL-HOMYANI 4


Notation of Activity Diagram

16-Nov-20 T.A GHADEER AL-HOMYANI 5


Notation of Activity Diagram

16-Nov-20 T.A GHADEER AL-HOMYANI 6


Notation of Activity Diagram

16-Nov-20 T.A GHADEER AL-HOMYANI 7


Guidelines for Creating Activity Diagram
- Set the context or scope of the activity being modeled.
- Identify the activities, control flows, and object flows that occur between
the activities.
- Identify any decisions that are part of the process being modeled.
- Identify any prospects for parallelism in the process.
Draw the activity diagram.

Scott Ambler

16-Nov-20 T.A GHADEER AL-HOMYANI 8


Drawing Activity Diagram
Are all the activities carried out by the same person, organization or department?
If not, then add swimlanes to show the responsibilities
Name the swimlanes
Show each activity in the appropriate swimlane

16-Nov-20 T.A GHADEER AL-HOMYANI 9


Notation of Activity Diagram

16-Nov-20 T.A GHADEER AL-HOMYANI 10


When Not to Use Activity Diagram
An activity diagram should be avoided if:
◦ The use case is simple and the graphical representation will
not be helpful

◦ The purpose is to examine how object collaborate – an


interaction diagrams should be used instead.

◦ The purpose is to see how an object behaves over its


lifetime. – used a statechart diagrams instead

16-Nov-20 T.A GHADEER AL-HOMYANI 11


Example 1:
Draw the activity diagram for preparing a Cup of Coffee with milk? The
process starts by entering the kitchen. Then you need to: fill kettle, boil
water, get a cup and add coffee. These activities can be done in any order or
concurrently. After the water is boiled, you need to pour water in the cup,
then add milk to it, and drink coffee.

16-Nov-20 T.A GHADEER AL-HOMYANI 12


preparing a Cup of Coffee with milk system

16-Nov-20 T.A GHADEER AL-HOMYANI 13


Example 2:

Redraw the activity diagram of preparing a cup coffee. The new diagram
should allow to check if cup is clean continue the process, if not wash
the cup.

16-Nov-20 T.A GHADEER AL-HOMYANI 14


preparing a Cup of Coffee with milk system

16-Nov-20 T.A GHADEER AL-HOMYANI 15


Example 3:

Redraw the activity diagram to allow the choice between


coffee with milk and coffee without milk.

16-Nov-20 T.A GHADEER AL-HOMYANI 16


The answer

16-Nov-20 T.A GHADEER AL-HOMYANI 17


Example 4: Activity Diagram for Login

16-Nov-20 T.A GHADEER AL-HOMYANI 18


Example 5:

16-Nov-20 T.A GHADEER AL-HOMYANI 19

You might also like