
CMPSCI520/620 UML 2 Activity Diagrams ßobject-oriented equivalent of flow charts and data flow diagrams (DFDs) from structured development ßtypically used for ßbusiness process modeling 11 - UML & Requirements ßmodeling the logic captured by a single use case or usage scenario ßmodeling the detailed logic of a business rule Rick Adrion ßcould potentially model ßthe internal logic of a complex operation ßfar better to simply rewrite the operation so that it is simple enough that you don’t require an activity diagram Scott W. Ambler , Copyright 2003 www.agilemodeling.com/ UNIVERSITY OF MASSACHUSETTS AMHERST • D EPARTMENT OF COMPUTER SCIENCE • CMP SCI 520/620 FALL 2003 UNIVERSITY OF MASSACHUSETTS AMHERST • D EPARTMENT OF COMPUTER SCIENCE • CMP SCI 520/620 FALL 2003 Activity Diagram Notation University enrollment example ß Decision “Swim lanes” ß Initial node Apply to ß filled circle = starting point of the ß A diamond with one flow entering and Fill out Universityy diagram, not required several leaving forms x ß Activity final node ß Merge ß A diamond with several flows entering applicant Enroll ß filled circle with a border is the and one leaving, all incoming flows in [incorrect] seminar ending point, can have zero or must reach this point until processing y more activity final nodes. continues, unless otherwise noted ß Activity ß Partition ß also called swimlanes, indicating Imput Must be on ß rounded rectangles represent forms Input [not on list] activities, may be physical or who/what is performing the activities applicant list of applicants, Select electronic ß Sub-activity indicator info but not in system applicant ß rake in the bottom corner of an activity from list ß Flow/edge indicates that the activity is described registrar ß arrows on the diagram by a more finely detailed activity ß Fork diagram. ß Flow final [correct] [not on match list] [on match list] ß A black bar with one flow going ß circle with the X through it, process into it and several leaving it, stops at this point. parallel activity. Check [on list] Create ß Use case Display applicant student ß Join ß non-official? indication that an included create student list ß A black bar with several flows use case is being invoked. screen entering it and one leaving it, Search [no match] denotes the end of parallel system for processing. applicant Display ß Condition list of ß a guard which must evaluate to [potential matches] matches true in order to traverse the node Scott W. Ambler , Copyright 2003 www.agilemodeling.com/ Scott W. Ambler , Copyright 2003 www.agilemodeling.com/ UNIVERSITY OF MASSACHUSETTS AMHERST • D EPARTMENT OF COMPUTER SCIENCE • CMP SCI 520/620 FALL 2003 UNIVERSITY OF MASSACHUSETTS AMHERST • D EPARTMENT OF COMPUTER SCIENCE • CMP SCI 520/620 FALL 2003 ”Rick Adrion 2003 (except where noted) 1 CMPSCI520/620 University enrollment example University enrollment example Use-case signal B: Forms not filled out course of action G: Not eligible to enroll Apply to University pin [incorrect] [not on list] [on list] H Verify Create applicant student Display is on list Fill out Imput create Input forms forms applicant student info See if screen applicant Is in system [no match] Basic Course Possible [not on match list] Security Alternative Risk [potential matches] Use-case time triggered Perform Display list of Security matches Check [on match list] Exisiting Use Case F: Student may be in System Scott W. Ambler , Copyright 2003 www.agilemodeling.com/ Scott W. Ambler , Copyright 2003 www.agilemodeling.com/ object UNIVERSITY OF MASSACHUSETTS AMHERST • D EPARTMENT OF COMPUTER SCIENCE • CMP SCI 520/620 FALL 2003 UNIVERSITY OF MASSACHUSETTS AMHERST • D EPARTMENT OF COMPUTER SCIENCE • CMP SCI 520/620 FALL 2003 When to Use Activity Diagrams Activity Diagram Modeling Tips ßUse activity diagrams when the behavior you are ßControl flow and object flow are not separate. Both are modeling ... modeled with state transitions. ßdoes not depend much on external events. ßDashed object flow lines are also control flow. ßmostly has steps that run to completion, rather than being interrupted by events. ßYou can mix state machine and control/object flow constructs on the same diagram (though you probably ßrequires object/data flow between steps. do not want to). ßis being constructed at a stage when you are more concerned with which activities happen, rather than which objects are responsible for them (except partitions possibly). UNIVERSITY OF MASSACHUSETTS AMHERST • D EPARTMENT OF COMPUTER SCIENCE • CMP SCI 520/620 FALL 2003 UNIVERSITY OF MASSACHUSETTS AMHERST • D EPARTMENT OF COMPUTER SCIENCE • CMP SCI 520/620 FALL 2003 ”Rick Adrion 2003 (except where noted) 2 CMPSCI520/620 Wrap Up: Activity Diagrams Statechart modeling ßUse Activity Diagrams for applications that are primarily ßCaptures dynamic changes of class states – the life control and data-driven, like business modeling … history of the class … rather than event-driven applications like embedded ßThese dynamic changes describe typically the behavior systems. of an object across several use cases ßState of an object – designated by the current values of ßActivity diagrams are a kind of state machine until UML the object's attributes 2.0 … ßStatechart Diagram – a bipartite graph of … so control and object/data flow do not have separate ßstates (rounded rectangles) and semantics. ßtransitions (arrows) caused by events ßThe concepts of states and events are the same concepts that we know from Activity Diagrams – the difference is that “the states of the activity graph represent the states of executing the computation, not the states of an ordinary object” UNIVERSITY OF MASSACHUSETTS AMHERST • D EPARTMENT OF COMPUTER SCIENCE • CMP SCI 520/620 FALL 2003 UNIVERSITY OF MASSACHUSETTS AMHERST • D EPARTMENT OF COMPUTER SCIENCE • CMP SCI 520/620 FALL 2003 Types of Events Types of Events ßUML defines 4 kinds of events ßEvents are occurrences of interest that have both ßSignal Event ßLocation ßAsynchronous signal received ßAbsolute time of occurrence ße.g. evFlameOn ßSignal events associate with Signals ßCall Event ßA Signal is a specification of an asynchronous ßoperation call received communication between structural elements (e.g. ße.g. op(a,b,c) objects) ßChange Event ßOne type of Signal is Exception ßchange in value occurred ßTime Event ßRelative time elapse ßAbsolute time arrived ße.g. tm(PulseWidthTime) UNIVERSITY OF MASSACHUSETTS AMHERST • D EPARTMENT OF COMPUTER SCIENCE • CMP SCI 520/620 FALL 2003 UNIVERSITY OF MASSACHUSETTS AMHERST • D EPARTMENT OF COMPUTER SCIENCE • CMP SCI 520/620 FALL 2003 ”Rick Adrion 2003 (except where noted) 3 CMPSCI520/620 States and transitions Statecharts & Activity Diagrams ßObjects change values of their attributes but not all such changes cause state transitions ßWe construct state models for classes that have interesting state changes, not any state changes ßStatechart Diagram is a model of business rules ßBusiness rules are invariable over some periods of time ßThey are relatively independent of particular use cases Heinrich Hussmann UNIVERSITY OF MASSACHUSETTS AMHERST • D EPARTMENT OF COMPUTER SCIENCE • CMP SCI 520/620 FALL 2003 UNIVERSITY OF MASSACHUSETTS AMHERST • D EPARTMENT OF COMPUTER SCIENCE • CMP SCI 520/620 FALL 2003 States and transitions Statechart Diagram ß Normally attached to a class, but can be attached to other modeling concepts, e.g. a use case ß When attached to a class, the diagram determines how objects of that class react to events ß Determines – for each object state – what action the object will perform when it receives an event ß The same object may perform a different action for the same event depending on the object’s state ß The action’s execution will typically cause a state change Heinrich Hussmann UNIVERSITY OF MASSACHUSETTS AMHERST • D EPARTMENT OF COMPUTER SCIENCE • CMP SCI 520/620 FALL 2003 UNIVERSITY OF MASSACHUSETTS AMHERST • D EPARTMENT OF COMPUTER SCIENCE • CMP SCI 520/620 FALL 2003 ”Rick Adrion 2003 (except where noted) 4 CMPSCI520/620 Statecharts Statechart notation ßCapture state-dependent requirements ßStatechart created for each state-dependent class ßUML provides hierarchical state transition diagrams ßBased on Harel statecharts ßInformation Captured ßStates ßCapture all possible states of the class ßEvents and conditions ßDescribe transitions between states ßActions ßIndicate processing that occurs on entry or exit to/from a state UNIVERSITY OF MASSACHUSETTS AMHERST • D EPARTMENT OF COMPUTER SCIENCE • CMP SCI 520/620 FALL 2003 UNIVERSITY OF MASSACHUSETTS AMHERST • D EPARTMENT OF COMPUTER SCIENCE • CMP SCI 520/620 FALL 2003 Example Nested submachines UNIVERSITY OF MASSACHUSETTS AMHERST • D EPARTMENT OF COMPUTER SCIENCE • CMP SCI 520/620 FALL 2003 UNIVERSITY OF MASSACHUSETTS AMHERST • D EPARTMENT OF COMPUTER SCIENCE • CMP SCI 520/620 FALL 2003 ”Rick Adrion 2003 (except where noted) 5 CMPSCI520/620 Implementation diagrams Requirements Process & Products Market Analysis Systems Analysis Market Needs Business Needs Business Planning System Requirements Component Diagram Systems Engineering Deployment Diagram Requirements Analysis Requirements Definition Requirements Definition Requirements Document System Specification Requirements Specification Behavioral Specification System Specification Specification Functional Specification Specification Document Requirements Specification Heinrich Hussmann UNIVERSITY OF MASSACHUSETTS AMHERST • D EPARTMENT OF COMPUTER SCIENCE • CMP SCI 520/620 FALL 2003 UNIVERSITY OF MASSACHUSETTS AMHERST • D EPARTMENT OF
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages17 Page
-
File Size-