exp 5 modeling uml activity diagram

Post on 03-Dec-2015

33 Views

Category:

Documents

1 Downloads

Preview:

Click to see full reader

DESCRIPTION

OOSE

TRANSCRIPT

Modeling UML Activity

Diagram

Prof. U.VERMA

C.E. Dept.

MPSTME Shirpur Campus

1upendra.verma@nmims.edu

Activity Diagrams

• Activity diagrams are one of the five diagrams inthe UML for modeling the dynamic aspects ofsystems.

• Activity diagrams fall under the category ofbehavioral diagrams in Unified ModelingLanguage.

• Visually represent the flow of control in a system.

• It is more powerful than a simple flow chart sinceit can represent various other concepts likeconcurrent activities, their joining, and so on.

2upendra.verma@nmims.edu

Activity Diagrams cont’d

• An activity diagram is essentially a flowchart,

showing flow of control from activity to

activity. Unlike a traditional flowchart, an

activity diagram shows concurrency as well as

branches of control.

upendra.verma@nmims.edu 3

Components of an Activity Diagram

• Activity

• Flow

• Decision

• Merge

• Fork

• Join

• Note

• Partition

4upendra.verma@nmims.edu

Activity

• An activity denotes a particular action taken in thelogical flow of control.

• Behavior expressed as a set of actions connectedby control and data flows.

• An activity is represented with a roundedrectangle.

• A label inside the rectangle identifies thecorresponding activity.

• There are two special type of activity nodes:initial and final.

5upendra.verma@nmims.edu

Activity cont’d

• Initial node represents the starting point of a

flow in an activity diagram.

• A final node represents the end point of all

activities.

6upendra.verma@nmims.edu

Flow

• A flow (also termed as edge, or transition) is

represented with a directed arrow.

• This is used to depict transfer of control from

one activity to another .

• A flow is often accompanied with a label,

called the guard condition, indicating the

necessary condition for the transition to

happen.

7upendra.verma@nmims.edu

Decision

• A decision node, represented with a diamond, is a point where

a single flow enters and two or more flows leave.

• The outgoing edges often have guard conditions indicating

true-false or if-then-else conditions. However, they can be

omitted in obvious cases.

• note can be attached to the decision node indicating the

condition to be tested.

8upendra.verma@nmims.edu

Merge

• This is represented with a diamond shape, with

two or more flows entering, and a single flow

leaving out.

• A merge node represents the point where at

least a single control should reach before

further processing could continue.

9upendra.verma@nmims.edu

Fork

• Fork is a point where parallel activities begin. For

example, when a student has been registered with

a college, he can in parallel apply for student ID

card and library card.

• A fork is graphically depicted with a black bar,

with a single flow entering and multiple flows

leaving out.

10upendra.verma@nmims.edu

Join

• A join is depicted with a black bar, with

multiple input flows, but a single output flow.

• It represents the synchronization of all

concurrent activities.

• Unlike a merge, in case of a join all of the

incoming controls must be completed before

any further progress could be made.

11upendra.verma@nmims.edu

Join cont’d

• For example, a sales order is closed only when

the customer has receive the product, and the

sales company has received it's payment.

12upendra.verma@nmims.edu

Note

• UML allows attaching a note to different

components of a diagram to present some

textual information.

• The information could simply be a comment or

may be some constraint.

13upendra.verma@nmims.edu

Partition

• Different components of an activity diagram

can be logically grouped into different areas,

called partitions or swim lanes.

• The drawing area can be partitioned into

multiple compartments using vertical (or

horizontal) parallel lines.

• Partitions in an activity diagram are not

mandatory.

14upendra.verma@nmims.edu

A Simple Example

• Figure shows a simple activity diagram with

two activities.

• The figure depicts two stages of a form

submission.

• At first a form is filled up with relevant and

correct information. Once it is verified that

there is no error in the form, it is then

submitted.

15upendra.verma@nmims.edu

A Simple Example cont’d

16upendra.verma@nmims.edu

Guidelines for drawing an Activity

Diagram

• Identify tiny pieces of work being performed

by the system.

• Identify the next logical activity that should be

performed.

• Put guard conditions on the edges to avoid

confusion

17upendra.verma@nmims.edu

Case Study of LIS

upendra.verma@nmims.edu 18

Case Study of LIS cont’d

From the given problem we can identify at least

three different functionality offered by the

system:

• Register a new member

• Issue book

• Update inventory

upendra.verma@nmims.edu 19

Activity diagram for user

registration

A new user fills up the registration form for library membership (either online or in

paper), and submits to the librarian. Of course, an already registered user can't create

another account for himself (or, herself). For users' who don't have an account already

and have submitted their registration forms, the librarian verifies the information

provided, possibly against the central database used by the institution. If all information

have been provided correctly, librarian goes on with creating a new account for the

user. Otherwise, the user is asked to provide all and correct information in his (her)

registration form. Once a new account has been created for the user, he (she) is being

issued an ID card, which is to be provided for any future transaction in the library.

upendra.verma@nmims.edu 20

Activity diagram for user

registration cont’d

upendra.verma@nmims.edu 21

Activity diagram for issuing books

upendra.verma@nmims.edu 22

Activity diagram for updating

inventory

upendra.verma@nmims.edu 23

Draw Activity

Diagram for

Admission Procedure

at NMIMS University

upendra.verma@nmims.edu 24

Activity Diagram for Student

Admission Procedure

upendra.verma@nmims.edu 25

Exercise

Draw Activity Diagram for Online Budgeting

Control System.

• Identify Activities

• Transition from one activity to another activity

• Identify Parallel Activities

• Identify role for component

• Identify the guard conditions

upendra.verma@nmims.edu 26

top related