Download presentation
Presentation is loading. Please wait.
1
1 © Wolfgang Pelz 2000-04UML2 UML Part 3
2
2 © Wolfgang Pelz 2000-04UML2 Chapter Ten State Machine Diagrams
3
3 © Wolfgang Pelz 2000-04UML2 State Machine Diagrams capture the lifecycle and behavior of objects, subsystems, or systems specify the sequence of states an object goes into, based on responses to events, and actions the object may perform
4
4 © Wolfgang Pelz 2000-04UML2 Terminology state - condition or situation in the life of an object determined by attributes transition - movement from one state to another event/trigger - an external stimulus that may cause a transition action - some activity that results in a change of state or a return value
5
5 © Wolfgang Pelz 2000-04UML2 Thanking Turning a computer on: states? transition? event? actions?
6
6 © Wolfgang Pelz 2000-04UML2 Notation
7
7 © Wolfgang Pelz 2000-04UML2 Example State Diagram Actions: “go up”, “go down”, “arrived”, … State: “On first floor”, Moving up”, “Idle”, …
8
8 © Wolfgang Pelz 2000-04UML2 Messages between State Diagrams
9
9 © Wolfgang Pelz 2000-04UML2 and-substate (concurrency)
10
10 © Wolfgang Pelz 2000-04UML2 Sequential Substates
11
11 © Wolfgang Pelz 2000-04UML2 Activity Diagram captures actions and their results variation of state diagram, but emphasizing actions actions: work and activities to be performed results: object-state changes (not the major point) actions may be placed in swimlanes
12
12 © Wolfgang Pelz 2000-04UML2 Activity Diagram (cont.) includes: how actions are taken what they do (activities) when they take place (action sequence) where they take place (swimlanes)
13
13 © Wolfgang Pelz 2000-04UML2 Example of a Printing Program
14
14 © Wolfgang Pelz 2000-04UML2 Another way...
15
15 © Wolfgang Pelz 2000-04UML2 Decision Point
16
16 © Wolfgang Pelz 2000-04UML2 Forks and Joins concurrent or parallel flow of control synchronization bar # of forks matches # of joins activities in parallel flows may use signals to communicate (such communicating sequential processes are called co-routines)
17
17 © Wolfgang Pelz 2000-04UML2 Example
18
18 © Wolfgang Pelz 2000-04UML2 Swimlanes (in Activity Diagrams) group activities with respect to their responsibilities useful when modeling workflows of business processes specify loci of activities every activity belongs to exactly one swimlane, but transitions may cross lanes
19
19 © Wolfgang Pelz 2000-04UML2 Example
20
20 © Wolfgang Pelz 2000-04UML2 Use an activity diagram when analyzing a use case understanding workflow across many use cases multi-threaded applications capturing the work to be performed as an operation is executing
21
21 © Wolfgang Pelz 2000-04UML2 Don’t use when... trying to see how objects collaborate (collaborative actions instead of individual activities); use an interaction diagram instead trying to see how an object behaves over its lifetime; use a state diagram instead modeling a scenario; instead attach it to the appropriate use case
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.