february 20, 2012 1998- present fayad ksu – swe process and modeling software process and...

33
February 20, 2012 1998-Present Fayad KSU – SWE Process and Modeling Software Process and Modeling Dr. M.E. Fayad, Professor Software Engineering Department, Room #2022 College of Computer and Information Sciences (CCISs) King Saud University P.O. Box 51178 Riyadh 11543 http://www.engr.sjsu.edu/fayad, [email protected]

Upload: loreen-carter

Post on 03-Jan-2016

215 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: February 20, 2012  1998- Present Fayad KSU – SWE Process and Modeling Software Process and Modeling Dr. M.E. Fayad, Professor Software Engineering Department,

February 20, 2012 1998-Present Fayad

KSU – SWE Process and Modeling

Software Process and Modeling

Dr. M.E. Fayad, ProfessorSoftware Engineering Department, Room #2022College of Computer and Information Sciences (CCISs)King Saud UniversityP.O. Box 51178Riyadh 11543http://www.engr.sjsu.edu/fayad, [email protected]

Page 2: February 20, 2012  1998- Present Fayad KSU – SWE Process and Modeling Software Process and Modeling Dr. M.E. Fayad, Professor Software Engineering Department,

LB3-d-S2 Activity DiagramsFebruary 20, 2012 1998-Present Fayad

KSU – SWE Process and Modeling

2

Lesson 02:Activity Diagrams

Page 3: February 20, 2012  1998- Present Fayad KSU – SWE Process and Modeling Software Process and Modeling Dr. M.E. Fayad, Professor Software Engineering Department,

LB3-d-S3 Activity DiagramsFebruary 20, 2012 1998-Present Fayad

KSU – SWE Process and Modeling

Lesson Objectives

Objectives

3

Discuss and understand activity diagrams Understand the elements of activity diagrams

Activity Transition Synch. Bar Decision Diamond Start & Stop Markers

Page 4: February 20, 2012  1998- Present Fayad KSU – SWE Process and Modeling Software Process and Modeling Dr. M.E. Fayad, Professor Software Engineering Department,

LB3-d-S4 Activity DiagramsFebruary 20, 2012 1998-Present Fayad KSU – SWE Process and Modeling

Describes how activities are coordinated.

Is particularly useful when you know that an operation has to achieve a number of different things, and you want to model what the essential dependencies between them are, before you decide in what order to do them.

Records the dependencies between activities, such as which things can happen in parallel and what must be finished before something else can start.

Represents the workflow of the process.

4

Activity Diagram

Page 5: February 20, 2012  1998- Present Fayad KSU – SWE Process and Modeling Software Process and Modeling Dr. M.E. Fayad, Professor Software Engineering Department,

LB3-d-S5 Activity DiagramsFebruary 20, 2012 1998-Present Fayad KSU – SWE Process and Modeling

5

Notation

Activity1()c Activity2()

1. Activities

2. Transition

Page 6: February 20, 2012  1998- Present Fayad KSU – SWE Process and Modeling Software Process and Modeling Dr. M.E. Fayad, Professor Software Engineering Department,

LB3-d-S6 Activity DiagramsFebruary 20, 2012 1998-Present Fayad

KSU – SWE Process and Modeling

6

Notation - 2

Activity1()c

[x>0]

[x=0]

[x<0]

[x>0]

[x=0]

[x<0]

3. Decision Diamond

Page 7: February 20, 2012  1998- Present Fayad KSU – SWE Process and Modeling Software Process and Modeling Dr. M.E. Fayad, Professor Software Engineering Department,

LB3-d-S7 Activity DiagramsFebruary 20, 2012 1998-Present Fayad

KSU – SWE Process and Modeling

7

Notation - 3

4.1 Synch. Bar (Join) 4.2 Splitting Bar (Fork)

{AND}{OR}

{XOR}

Page 8: February 20, 2012  1998- Present Fayad KSU – SWE Process and Modeling Software Process and Modeling Dr. M.E. Fayad, Professor Software Engineering Department,

LB3-d-S8 Activity DiagramsFebruary 20, 2012 1998-Present Fayad

KSU – SWE Process and Modeling

8

Notation - 3

5. Start & Stop Markers

Start Marker Stop Marker

Page 9: February 20, 2012  1998- Present Fayad KSU – SWE Process and Modeling Software Process and Modeling Dr. M.E. Fayad, Professor Software Engineering Department,

LB3-d-S9 Activity DiagramsFebruary 20, 2012 1998-Present Fayad

KSU – SWE Process and Modeling

9

Notation - 4

Application/Department/Group/Role Boundaries

Developers Testers Markers

Swimlane SwimlaneSwimlane

Page 10: February 20, 2012  1998- Present Fayad KSU – SWE Process and Modeling Software Process and Modeling Dr. M.E. Fayad, Professor Software Engineering Department,

LB3-d-S10 Activity DiagramsFebruary 20, 2012 1998-Present Fayad

KSU – SWE Process and Modeling

10

Example: Business Level Activity Diagram of the Library

member Librarian

[borrower]

[returner]

Find book on shelf

Wait in queue

Prepare for next member

Record borrowing

Record return Put book back of shelf

[returning]

[borrowing]

Page 11: February 20, 2012  1998- Present Fayad KSU – SWE Process and Modeling Software Process and Modeling Dr. M.E. Fayad, Professor Software Engineering Department,

LB3-d-S11 Activity DiagramsFebruary 20, 2012 1998-Present Fayad

KSU – SWE Process and Modeling

To model the dynamic aspects of a system

It is essentially a flowchart

– Showing flow of control from activity to activity

Purpose

– Model business workflows

– Model operations

11

Activity Diagrams (1)

Page 12: February 20, 2012  1998- Present Fayad KSU – SWE Process and Modeling Software Process and Modeling Dr. M.E. Fayad, Professor Software Engineering Department,

LB3-d-S12 Activity DiagramsFebruary 20, 2012 1998-Present Fayad

KSU – SWE Process and Modeling

Activity diagrams commonly contain

– Activity states and action states

– Transitions

– Objects

12

Activity Diagrams (2)

Page 13: February 20, 2012  1998- Present Fayad KSU – SWE Process and Modeling Software Process and Modeling Dr. M.E. Fayad, Professor Software Engineering Department,

LB3-d-S13 Activity DiagramsFebruary 20, 2012 1998-Present Fayad

KSU – SWE Process and Modeling

Action states are atomic and cannot be

decomposed

– Work of the action state is not interrupted

Activity states can be further decomposed

– Their activity being represented by other activity

diagrams

– They may be interrupted

13

Action States and Activity States

Page 14: February 20, 2012  1998- Present Fayad KSU – SWE Process and Modeling Software Process and Modeling Dr. M.E. Fayad, Professor Software Engineering Department,

LB3-d-S14 Activity DiagramsFebruary 20, 2012 1998-Present Fayad

KSU – SWE Process and Modeling

When the action or activity of a state completes, flow of control passes immediately to the next action or activity state

A flow of control has to start and end someplace

– initial state -- a solid ball

– stop state -- a solid ball inside a circle

14

Transitions (1)

Page 15: February 20, 2012  1998- Present Fayad KSU – SWE Process and Modeling Software Process and Modeling Dr. M.E. Fayad, Professor Software Engineering Department,

LB3-d-S15 Activity DiagramsFebruary 20, 2012 1998-Present Fayad

KSU – SWE Process and Modeling

15

Transitions (2)

Page 16: February 20, 2012  1998- Present Fayad KSU – SWE Process and Modeling Software Process and Modeling Dr. M.E. Fayad, Professor Software Engineering Department,

LB3-d-S16 Activity DiagramsFebruary 20, 2012 1998-Present Fayad

KSU – SWE Process and Modeling

16

Activity Diagram: Example (1)

Page 17: February 20, 2012  1998- Present Fayad KSU – SWE Process and Modeling Software Process and Modeling Dr. M.E. Fayad, Professor Software Engineering Department,

LB3-d-S17 Activity DiagramsFebruary 20, 2012 1998-Present Fayad

KSU – SWE Process and Modeling

A branch specifies alternate paths

taken based on some Boolean

expression

A branch may have one incoming

transition and two or more outgoing

ones 17

Branching (1)

Page 18: February 20, 2012  1998- Present Fayad KSU – SWE Process and Modeling Software Process and Modeling Dr. M.E. Fayad, Professor Software Engineering Department,

LB3-d-S18 Activity DiagramsFebruary 20, 2012 1998-Present Fayad

KSU – SWE Process and Modeling

18

Branching (2)

Page 19: February 20, 2012  1998- Present Fayad KSU – SWE Process and Modeling Software Process and Modeling Dr. M.E. Fayad, Professor Software Engineering Department,

LB3-d-S19 Activity DiagramsFebruary 20, 2012 1998-Present Fayad

KSU – SWE Process and Modeling

19

Activity Diagram: Example (2)

Page 20: February 20, 2012  1998- Present Fayad KSU – SWE Process and Modeling Software Process and Modeling Dr. M.E. Fayad, Professor Software Engineering Department,

LB3-d-S20 Activity DiagramsFebruary 20, 2012 1998-Present Fayad

KSU – SWE Process and Modeling

Use a synchronization bar to specify

the forking and joining of parallel flows

of control

A synchronization bar is rendered as a

thick horizontal or vertical line

20

Forking and Joining

Page 21: February 20, 2012  1998- Present Fayad KSU – SWE Process and Modeling Software Process and Modeling Dr. M.E. Fayad, Professor Software Engineering Department,

LB3-d-S21 Activity DiagramsFebruary 20, 2012 1998-Present Fayad

KSU – SWE Process and Modeling

A fork may have one incoming transitions

and two or more outgoing transitions– each transition represents an independent flow of

control

– conceptually, the activities of each of outgoing

transitions are concurrent

• either truly concurrent (multiple nodes)

• or sequential yet interleaved (one node)

21

Fork

Page 22: February 20, 2012  1998- Present Fayad KSU – SWE Process and Modeling Software Process and Modeling Dr. M.E. Fayad, Professor Software Engineering Department,

LB3-d-S22 Activity DiagramsFebruary 20, 2012 1998-Present Fayad

KSU – SWE Process and Modeling

A join may have two or more incoming

transitions and one outgoing transition

– above the join, the activities associated with each

of these paths continues in parallel

– at the join, the concurrent flows synchronize

• each waits until all incoming flows have reached the

join, at which point one flow of control continues on

below the join 22

Join

Page 23: February 20, 2012  1998- Present Fayad KSU – SWE Process and Modeling Software Process and Modeling Dr. M.E. Fayad, Professor Software Engineering Department,

LB3-d-S23 Activity DiagramsFebruary 20, 2012 1998-Present Fayad

KSU – SWE Process and Modeling

23

Fork

Page 24: February 20, 2012  1998- Present Fayad KSU – SWE Process and Modeling Software Process and Modeling Dr. M.E. Fayad, Professor Software Engineering Department,

LB3-d-S24 Activity DiagramsFebruary 20, 2012 1998-Present Fayad

KSU – SWE Process and Modeling

24

Activity Diagram: Example (3)

Page 25: February 20, 2012  1998- Present Fayad KSU – SWE Process and Modeling Software Process and Modeling Dr. M.E. Fayad, Professor Software Engineering Department,

LB3-d-S25 Activity DiagramsFebruary 20, 2012 1998-Present Fayad

KSU – SWE Process and Modeling

25

Activity Diagram: Example (4)

Page 26: February 20, 2012  1998- Present Fayad KSU – SWE Process and Modeling Software Process and Modeling Dr. M.E. Fayad, Professor Software Engineering Department,

LB3-d-S26 Activity DiagramsFebruary 20, 2012 1998-Present Fayad

KSU – SWE Process and Modeling

26

Activity Diagram: Example (5)

Page 27: February 20, 2012  1998- Present Fayad KSU – SWE Process and Modeling Software Process and Modeling Dr. M.E. Fayad, Professor Software Engineering Department,

LB3-d-S27 Activity DiagramsFebruary 20, 2012 1998-Present Fayad

KSU – SWE Process and Modeling

27

Activity Diagram: Example (6)

Page 28: February 20, 2012  1998- Present Fayad KSU – SWE Process and Modeling Software Process and Modeling Dr. M.E. Fayad, Professor Software Engineering Department,

LB3-d-S28 Activity DiagramsFebruary 20, 2012 1998-Present Fayad

KSU – SWE Process and Modeling

28

Activity Diagram: Example (7)

Page 29: February 20, 2012  1998- Present Fayad KSU – SWE Process and Modeling Software Process and Modeling Dr. M.E. Fayad, Professor Software Engineering Department,

LB3-d-S29 Activity DiagramsFebruary 20, 2012 1998-Present Fayad

KSU – SWE Process and Modeling

A swimlane specifies a locus of activities To partition the activity states on an activity

diagram into groups– each group representing the business organization

responsible for those activities

– each group is called a swimlane

Each swimlane is divided from its neighbor by a vertical solid line

29

Swimlanes (1)

Page 30: February 20, 2012  1998- Present Fayad KSU – SWE Process and Modeling Software Process and Modeling Dr. M.E. Fayad, Professor Software Engineering Department,

LB3-d-S30 Activity DiagramsFebruary 20, 2012 1998-Present Fayad

KSU – SWE Process and Modeling

Each swimlane has a name unique within its diagram

Each swimlane may represent some real-world entity

Each swimlane may be implemented by one or more classes

Every activity belongs to exactly one swimlane, but transitions may cross lanes 30

Swimlanes (2)

Page 31: February 20, 2012  1998- Present Fayad KSU – SWE Process and Modeling Software Process and Modeling Dr. M.E. Fayad, Professor Software Engineering Department,

LB3-d-S31 Activity DiagramsFebruary 20, 2012 1998-Present Fayad

KSU – SWE Process and Modeling

31

Activity Diagram: Example (8)

Page 32: February 20, 2012  1998- Present Fayad KSU – SWE Process and Modeling Software Process and Modeling Dr. M.E. Fayad, Professor Software Engineering Department,

LB3-d-S32 Activity DiagramsFebruary 20, 2012 1998-Present Fayad

KSU – SWE Process and Modeling

32

Activity Diagram: Example (9)

Page 33: February 20, 2012  1998- Present Fayad KSU – SWE Process and Modeling Software Process and Modeling Dr. M.E. Fayad, Professor Software Engineering Department,

LB3-d-S33 Activity DiagramsFebruary 20, 2012 1998-Present Fayad

KSU – SWE Process and Modeling

33

Discussion Questions

What are the element of activity diagrams?

T/F

– Activity diagram is a behavior model.

– Activity diagram is a control model.

Define:

– Activity diagram