Activity Diagram - PowerPoint PPT Presentation

1 / 11
About This Presentation
Title:

Activity Diagram

Description:

similar to flow chart, used in 1960's and 1970's. an activity is a ... Use case 'withdraw' with overdraft protection. N' represents overdraft limit. true. false ... – PowerPoint PPT presentation

Number of Views:100
Avg rating:3.0/5.0
Slides: 12
Provided by: kasiper
Category:

less

Transcript and Presenter's Notes

Title: Activity Diagram


1
Activity Diagram
2
Activity diagram
  • a diagram that represents a sequence of
    activities
  • similar to flow chart, used in 1960s and 1970s
  • an activity is a group of atomic actions
  • an action is indivisible (atomic) task
  • example change the value of a variable/field
  • an activity may consist of sub-activities or
    actions or both
  • in general, activities may be decomposable but
    actions are not.
  • activities can be interrupted by events, but
    actions are not.

3
Activity diagram - structure
final
action
initial
subactivity
C
branch
merge
C
action
C Boolean expression
4
Activity diagram - semantics
  • an activity diagram consists of a collection of
    action states, subactivities and transitions
  • every activity diagram must have only one initial
    state and one or more final states
  • the initial state represents the beginning of the
    activity and a final state represents the
    termination of an activity
  • actions are represented by action states (rounded
    rectangles)
  • a subactivity is also represented by a rounded
    rectangle but with an icon inside the rectangle

5
Activity diagram semantics (continued)
  • when expanded, each subactivity is
    diagrammatically substituted with the incoming
    and outgoing transitions matched
  • Instructor explain this with an example
  • sequence of actions is represented by transitions
    between actions
  • transitions are simple straight arrows with no
    labels or parameters
  • transitions are augmented with conditions at
    branching

6
Activity diagram semantics (continued)
  • a branch is represented by a diamond
  • has one incoming transition to enter the branch
  • two outgoing transitions augmented with mutually
    exclusive conditions
  • a merger is also represented by a diamond
  • two or three incoming transitions and one
    outgoing transition
  • the outgoing transition will be fired only when
    both the incoming transitions are fired

7
When to use an activity diagram
  • an activity diagram can be used to
  • describe a use case
  • describe a method in a collaboration diagram
  • describe an action associated with a transition
    in a state diagram, or the entry action or the
    exit action of a state diagram
  • Caution the word action in state diagram
    represents a higher level task while the same
    word in an activity diagram represents an atomic
    non-divisible computation

8
false
amount gt 0
report error
true
false
balance ? amount
report error
true
balance balance - amount
Use case withdraw with no overdraft protection
9
false
amount gt 0
report error
true
false
balance ? amount
amount balance ? N
false
report error
true
true
balance balance - amount
Use case withdraw with overdraft
protection N represents overdraft limit
10
Exercise Employment Exchange
  • Draw the activity diagram for the following use
    cases in the Employment Exchange case study
  • Login
  • Change profile
  • Accept job

11
Exercise Traffic Light
  • Draw the activity diagrams for the following use
    cases in the Intelligent Traffic Light case
    study
  • Change lights
  • Change red to green arrow
Write a Comment
User Comments (0)
About PowerShow.com