6. activity diagrams

6,682 views

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
6,682
On SlideShare
0
From Embeds
0
Number of Embeds
4
Actions
Shares
0
Downloads
181
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide
  • 1
  • 6. activity diagrams

    1. 1. Activity Diagrams Chapter 6Object-Oriented Software Systems Engineering – Chapter 6 Slide 1
    2. 2. Objectives In this chapter we will:  Introduce Activity Diagrams  Discuss where activity diagrams are usedObject-Oriented Software Systems Engineering – Chapter 6 Slide 2
    3. 3. Activity Diagrams  Use activity diagrams in the context of  system as whole  a subsystem  an operation  Model dynamic aspect of a system in two ways  a workflow -- to visualise , specify, construct, and document business processes  an operation -- to model the details of a computation involved with parameters of the operations and its local objectsObject-Oriented Software Systems Engineering – Chapter 6 Slide 3
    4. 4. Activity Diagrams  Activity  a sort of state which is left by the previous activity  activity can involve many steps, including waiting for events  Transition  an arrow line without label  actions are included in activities rather than on the transition  Synchronisation bar  describing the co-ordination of activities  waiting for all the subtasks to finish before proceeding (join),  starting several subtasks in parallel (fork)Object-Oriented Software Systems Engineering – Chapter 6 Slide 4
    5. 5. Activity Diagrams  Decision activity  an alternative to guard conditions on separate transitions leaving the same state  Swimlanes and partitions  several groups of related activities  these activities are related according to which objects or actors perform them  Start and stopObject-Oriented Software Systems Engineering – Chapter 6 Slide 5
    6. 6. Activity Diagrams Decision activity Activity 1 Activity 2 [condition 1] start [condition 2] Activity 3 Activity 4 Activity 5 Synchronisation bar stopObject-Oriented Software Systems Engineering – Chapter 6 Slide 6
    7. 7. Activity Diagrams - modelling workflow  Establish a focus for the workflow to show all interesting activities in one diagram  Select the business objects that have high-level responsibility for the parts of the overall workflow, and each important business object is associated with a swimlane  Identify the pre-conditions and post-conditions of the workflow  Specify the activities and actions that take place over timeObject-Oriented Software Systems Engineering – Chapter 6 Slide 7
    8. 8. Activity Diagrams - modelling workflow  Provide a separate activity diagram to expand complicated actions or set of actions  Consider branching activities with forking and joining  There are more advanced featuresObject-Oriented Software Systems Engineering – Chapter 6 Slide 8
    9. 9. Activity Diagrams - modelling an operation  Collect the abstractions that are involved in the operation (parameters, return type, attributes)  Identify pre & post conditions & any invariants  Beginning at the operations initial state, specify the activity & actions that take place over time & render them in an activity diagram as either activity states or action states  Use branching as necessary to specify conditional paths and iteration  Use forking and joining as necessary to specify parallel flows of controlObject-Oriented Software Systems Engineering – Chapter 6 Slide 9
    10. 10. Activity Diagrams - Example [joined bank] log on second level authorisation make manage payment instructionObject-Oriented Software Systems Engineering – Chapter 6 Slide 10
    11. 11. Library Users Librarian Activity diagrams [borrow] Find book Example on shelf [return] Wait in queue [returning] [borrowing] Record Put book return back on shelf Spot the mistakes! Record borrowing Prepare for next userObject-Oriented Software Systems Engineering – Chapter 6 Slide 11
    12. 12. Customer Sales Warehouse Request product Process order Pull materials Ship order Receive order Bill customer Pay bill Activity diagrams Close order - ExampleObject-Oriented Software Systems Engineering – Chapter 6 Slide 12
    13. 13. Activity diagrams - Example 4 [grade >= 40] print “Failed” [false] [true] print “Passed”Object-Oriented Software Systems Engineering – Chapter 6 Slide 13
    14. 14. Activity Diagrams - Example [grade >= 40] print “Failed” [false] [true] print “Passed”Object-Oriented Software Systems Engineering – Chapter 6 Slide 14
    15. 15. More About Activity Diagrams  Suitable for:  Analysing a use case  Understand what actions need to take place  Describe the behavioural dependencies between objects  Allocate operations to objects within interactive diagrams  Understanding workflow across many cases  Representing use cases interacting with each other  Dealing with multithreaded applications  Not suitable for:  Trying to see how objects collaborate – use collaboration diagrams instead  Trying to see how an object behaves over its lifetime – use state diagrams insteadObject-Oriented Software Systems Engineering – Chapter 6 Slide 15
    16. 16. Summary In this chapter we have:  Introduced Activity Diagrams  Discussed where activity diagrams are usedObject-Oriented Software Systems Engineering – Chapter 6 Slide 16

    ×