
UML Activity Diagrams, State-Machine Diagrams and Modelling Lecture # 2 Department of Computer Science and Technology University of Bedfordshire Written by David Goodwin, based on the book Applying UML and Patterns (3rd ed.) by C. Larman (2005). Modelling and Simulation, 2012 UML Activity Outline Diagrams, State-Machine Diagrams and Modelling Activity Diagrams Introduction Activity Activity Diagrams - notation Diagrams Introduction How to apply activity diagrams Activity Diagrams - notation Guidelines How to apply activity diagrams Guidelines State-Machine Diagrams State-Machine Diagrams Introduction Introduction State-Machine State-Machine Diagrams - notation Diagrams - How to apply state-machine diagrams notation How to apply state-machine diagrams Further Examples Further Examples UML Activity Diagrams, State-Machine Diagrams and Modelling Activity Diagrams Introduction Activity Diagrams Activity Diagrams - notation How to apply activity diagrams Guidelines State-Machine Diagrams Introduction State-Machine Diagrams - notation How to apply state-machine diagrams Further Examples UML Activity What is an Activity Diagram Diagrams, State-Machine Diagrams and Modelling I An Activity Diagram is on of the Behaviour diargams. I Activity modelling is the sequence and conditions for coordinating lower-level behaviours, rather than which classifiers own those behaviours. Activity Diagrams I These are commonly called control flow and object flow Introduction Activity Diagrams models. - notation How to apply I The behaviours coordinated by these models can be activity diagrams initiated because other behaviours finish executing, Guidelines State-Machine because objects and data become available, or because Diagrams events occur external to the flow. Introduction State-Machine I A UML Activity Diagram shows sequential and parallel Diagrams - notation activities in a process. How to apply state-machine I Useful for modelling: diagrams I Business processes Further Examples I Workflows I Data flows I Complex algorithms UML Activity Basic UML Activity Diagram notation Diagrams, State-Machine Diagrams and Modelling Action It does something. There is automatic transition on its completion. A transition Activity (arrows between actions) supports modelling of Diagrams Introduction control flow. Activity Diagrams - notation Fork One incoming transition, and multiple outgoing How to apply activity diagrams parallel transitions and/or object flows. Guidelines Multiple incoming transitions and/or object State-Machine Join Diagrams flows; one outgoing transitions. The outgoing Introduction State-Machine continuation does not happen until all the Diagrams - notation inputs arrive from all flows. How to apply state-machine Object Node An object produced or used by actions. This diagrams Further allows us to model data flows or object flows. Examples UML Activity Initial and Final Nodes Diagrams, State-Machine Diagrams and Modelling I Initial Node: I An initial node is a control node at which flow starts when the activity is invoked. I An activity may have more than one initial node. Activity Diagrams Introduction Activity Diagrams - notation How to apply activity diagrams Guidelines State-Machine Diagrams I Final Node: Introduction State-Machine I An activity may have more than one activity final node; Diagrams - the first one reached stops all flows in the activity. notation How to apply state-machine diagrams Further Examples UML Activity Action Diagrams, State-Machine Diagrams and Modelling I Action: I An action represents a single step within an activity that is not further decomposed within the activity. I An activity represents a behaviour that is composed of Activity individual elements that are actions. Diagrams Introduction I An action is simple from the point of view of the Activity Diagrams activity containing it, but may be complex in its effect - notation How to apply and not be atomic. activity diagrams I An activity can be reused in many places, whereas an Guidelines instance of an action is only used once at a particular State-Machine point in an activity. Diagrams Introduction I An action will not begin execution until all of its input State-Machine Diagrams - conditions are satisfied. notation How to apply state-machine diagrams Further Examples UML Activity Merge and Decision Nodes Diagrams, State-Machine Diagrams and Modelling I Merge Node: I A merge node is a control node that brings together multiple alternate flows. Activity I It is not used to synchronize concurrent flows but to Diagrams accept one among several alternate flows. Introduction I Activity Diagrams A merge node has multiple incoming edges and a single - notation outgoing edge. How to apply activity diagrams I Decision Node: Guidelines I A decision node accepts tokens on an incoming edge State-Machine Diagrams and presents them to multiple outgoing edges. Introduction I Which of the edges is actually traversed depends on the State-Machine Diagrams - evaluation of the guards on the outgoing edges. notation How to apply state-machine diagrams Further Examples UML Activity Join and Fork Nodes Diagrams, State-Machine Diagrams and Modelling I Join Node: I A join node is a control node that synchronizes multiple flows. I A join node has multiple incoming edges and one Activity outgoing edge. Diagrams Introduction I Fork Node: Activity Diagrams - notation I A fork node is a control node that splits a flow into How to apply multiple concurrent flows. activity diagrams Guidelines I A fork node has one incoming edge and multiple State-Machine outgoing edges. Diagrams Introduction State-Machine Diagrams - notation How to apply state-machine diagrams Further Examples UML Activity Object Node Diagrams, State-Machine Diagrams and Modelling I Object Node: I An object node is an activity node that indicates an Activity instance of a particular classifier, possibly in a particular Diagrams state, may be available at a particular point in the Introduction Activity Diagrams activity. - notation How to apply I Object nodes can be used in a variety of ways, activity diagrams depending on where objects are flowing from and to. Guidelines State-Machine Diagrams Introduction State-Machine Diagrams - notation How to apply state-machine diagrams Further Examples UML Activity Note Diagrams, State-Machine Diagrams and Modelling I Note: Activity Diagrams I A note (comment) gives the ability to attach various Introduction remarks to elements. Activity Diagrams - notation I A comment carries no semantic force, but may contain How to apply information that is useful to a modeller. activity diagrams Guidelines State-Machine Diagrams Introduction State-Machine Diagrams - notation How to apply state-machine diagrams Further Examples UML Activity Buisness Process Modelling Diagrams, State-Machine Diagrams and Modelling Activity I Example: Parcel shipping Diagrams Introduction I The process of shipping a parcel is non-trivial; there are Activity Diagrams many parties involived (customer, driver,. ) and many - notation How to apply steps. activity diagrams I The process can be captured by a Use Case diagram, Guidelines but activity diagrams are great example of \a picture State-Machine Diagrams being worth a thousand words". Introduction I Object nodes are useful for illustrating what is moving State-Machine Diagrams - around. notation How to apply state-machine diagrams Further Examples UML Activity Activity Diagram Parcel shipping Diagrams, State-Machine Diagrams and Modelling Activity Diagrams Introduction Activity Diagrams - notation How to apply activity diagrams Guidelines State-Machine Diagrams Introduction State-Machine Diagrams - notation How to apply state-machine diagrams Further Examples UML Activity Guideline for Activity Modelling Diagrams, State-Machine Diagrams and Modelling I The technique proves most valuable for very complex Activity processes, usually involving many parties. Diagrams Introduction I On a first overview \level 0" diagram, keep all the Activity Diagrams - notation actions at a very high level of abstraction, so that the How to apply activity diagrams diagram is short. Then expand details in sub-diagrams Guidelines at the \level 1" level,. etc. State-Machine Diagrams I Try to make the level of abstraction of action nodes Introduction State-Machine roughly equal withn a diagram (Very different levels of Diagrams - abstraction might be a node labelled \Deliver Order" notation How to apply state-machine and a node labelled \Calculate Tax"). diagrams Further Examples UML Activity Diagrams, State-Machine Diagrams and Modelling Activity Diagrams Introduction State-Machine Activity Diagrams - notation How to apply Diagrams activity diagrams Guidelines State-Machine Diagrams Introduction State-Machine Diagrams - notation How to apply state-machine diagrams Further Examples UML Activity What is a State-Machine Diagram Diagrams, State-Machine Diagrams and Modelling I State-Machine Diagrams specify state machines. I As with Activity Diagrams, UML State-Machine Diagrams show a dynamic flow. Activity Diagrams I The UML includes notation to illustrate events and Introduction states of things (transactions, Use Cases, Activity Diagrams - notation people,. etc.). How to apply activity diagrams I An event is a significant or noteworthy occurence e.g. a Guidelines telephone receiver is taken off the hook. State-Machine Diagrams I A state is the condition of an object at a moment in Introduction time e.g. a telephone is in the state of being \idle" State-Machine Diagrams - after the receiver is place on the hook
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages33 Page
-
File Size-