activity modeling

25
Copyright 2005 by Glenn L. Ray, all rights reserved Lecture 6 Activity Diagrams (Fowler Chp 11) (Figures from Fowler, UML Distilled )

Upload: chaidirally

Post on 21-Dec-2015

222 views

Category:

Documents


1 download

DESCRIPTION

Rekayasa Perangkat Lunak

TRANSCRIPT

Page 1: Activity Modeling

Copyright 2005 by Glenn L. Ray, all rights reserved

Lecture 6

Activity Diagrams(Fowler Chp 11)

(Figures from Fowler, UML Distilled)

Page 2: Activity Modeling

Copyright 2005 by Glenn L. Ray, all rights reserved

Activity Diagrams

• Modern version of classic flowchart– Updated to show parallel flow– Significantly updated in UML 2.0

• Most versatile UML diagram– Procedural logic– Algorithms– Business process– Workflow– Complex use case flows– Substitute for classic data flow diagram

Page 3: Activity Modeling

Copyright 2005 by Glenn L. Ray, all rights reserved

Activity Diagrams

• Most underutilized UML diagram– Don’t require technical SAD expertise– Don’t require OOAD expertise– Understandable by stakeholders– Can show varying level of complexity

Page 4: Activity Modeling

Copyright 2005 by Glenn L. Ray, all rights reserved

Activity Diagrams

• Diagram essentials– Initial & Final Nodes

• Beginning & end of diagram• Final node is within circle

– Actions• Rounded rectangles• An activity is a sequence of actions• For clarity, show 1 incoming & 1 outgoing edge/action

– Forks & Joins• Beginning & end of parallel activities• Think multithreaded processes• Forks must be completed by joins

Page 5: Activity Modeling

Copyright 2005 by Glenn L. Ray, all rights reserved

Activity Diagrams

– Directed arrows (flow/edge)• Show sequence of activities

– Diamonds w/ outward flows (decision)• Depict alternative flow based on boolean

expression• Think if/else

– Diamonds w/ inward flows (merge)• Reconnects a thread after a decision is completed• Think initial statement after an if/else block

Page 6: Activity Modeling

Copyright 2005 by Glenn L. Ray, all rights reserved

Activity Diagrams

Page 7: Activity Modeling

Copyright 2005 by Glenn L. Ray, all rights reserved

Activity Diagrams

• Actions can be decomposed into activity diagrams

• Enclosing action is labeled– It contains an activity diagram

• Next figure shows a detailed activity diagram of the order action

Page 8: Activity Modeling

Copyright 2005 by Glenn L. Ray, all rights reserved

Activity Diagrams

Page 9: Activity Modeling

Copyright 2005 by Glenn L. Ray, all rights reserved

Activity Diagrams

• Rake symbol in an action implies presence of sub-activity diagram for the action

• See next figure

Page 10: Activity Modeling

Copyright 2005 by Glenn L. Ray, all rights reserved

Activity Diagrams

Page 11: Activity Modeling

Copyright 2005 by Glenn L. Ray, all rights reserved

Activity Diagrams

• Partitions (aka swimlanes)– Depict who is responsible for completing an

action– Very useful for workflow modeling

Page 12: Activity Modeling

Copyright 2005 by Glenn L. Ray, all rights reserved

Activity Diagrams

Page 13: Activity Modeling

Copyright 2005 by Glenn L. Ray, all rights reserved

Activity Diagrams

• Signals– Action sequence may initiate due to a signal or event

(e.g., time) • Hourglass symbol

– Actions listen for signals • Action with inward angled edge

– Actions may generate signals for other actions • Action with outward angled edge

– Hourglass symbol used for signal

Page 14: Activity Modeling

Copyright 2005 by Glenn L. Ray, all rights reserved

Activity Diagrams

Page 15: Activity Modeling

Copyright 2005 by Glenn L. Ray, all rights reserved

Activity Diagrams

Page 16: Activity Modeling

Copyright 2005 by Glenn L. Ray, all rights reserved

Activity Diagrams

• Flows & Edges– Synonymous terms– Usually directed lines (arrowhead implies

direction)– Can use connector symbols for drawing clarity

• Helps when diagrams continues on another page

– Objects can be passed along edges

Page 17: Activity Modeling

Copyright 2005 by Glenn L. Ray, all rights reserved

Activity Diagrams

Page 18: Activity Modeling

Copyright 2005 by Glenn L. Ray, all rights reserved

Activity Diagrams

• Pins & Transformations– Actions can have parameters like methods– An action’s outputs must correspond to inputs of next

action– If outputs != inputs then must indicate a

transformation

Page 19: Activity Modeling

Copyright 2005 by Glenn L. Ray, all rights reserved

Activity Diagrams

Page 20: Activity Modeling

Copyright 2005 by Glenn L. Ray, all rights reserved

Activity Diagrams

• Expansion regions– Used to show iteration (looping) over a collection

• Internal actions can be sequential or parallel (concurrent)

– Enclosed actions occur once for each item in collection

Page 21: Activity Modeling

Copyright 2005 by Glenn L. Ray, all rights reserved

Activity Diagrams

Page 22: Activity Modeling

Copyright 2005 by Glenn L. Ray, all rights reserved

Activity Diagrams

• Flow final– Essentially a terminating node within an expansion

region– Each iteration need not produce an output token– Shows a filtering operation

Page 23: Activity Modeling

Copyright 2005 by Glenn L. Ray, all rights reserved

Activity Diagrams

Page 24: Activity Modeling

Copyright 2005 by Glenn L. Ray, all rights reserved

Activity Diagrams

• Join specification– Allows boolean constraint to control the

behavior of a join

Page 25: Activity Modeling

Copyright 2005 by Glenn L. Ray, all rights reserved

Activity Diagrams