State Machine Diagram
description
Transcript of State Machine Diagram
![Page 1: State Machine Diagram](https://reader036.fdocuments.us/reader036/viewer/2022062501/5681624b550346895dd28f8f/html5/thumbnails/1.jpg)
State Machine Diagram
Additional notes: Notes I picked-up on the Internet:• University of Toronto,• Craig D Wilson (Matincor, Inc.)
Chapter 5
![Page 2: State Machine Diagram](https://reader036.fdocuments.us/reader036/viewer/2022062501/5681624b550346895dd28f8f/html5/thumbnails/2.jpg)
2
Revision: (World View) Use Case Fully Descriptive Use Case Activity Diagram Domain Model Diagram SSD State Machine Diagram Component Diagrams Deployment Diagrams
Next Semester
![Page 3: State Machine Diagram](https://reader036.fdocuments.us/reader036/viewer/2022062501/5681624b550346895dd28f8f/html5/thumbnails/3.jpg)
3
Modeling and role of UML: The model is only useful if the model’s
phenomena correspond in a systematic way to the phenomena of the domain being modeled
Modeling can guide elicitation It can help figure out what questions to ask It can help to surface hidden requirements
Modeling can provide a measure of progress
![Page 4: State Machine Diagram](https://reader036.fdocuments.us/reader036/viewer/2022062501/5681624b550346895dd28f8f/html5/thumbnails/4.jpg)
4
Modeling Principle Abstraction:
Strip away detail to concentrate on the relevant or important things
A way of finding similarities between concepts by ignoring irrelevant detail
Iterative development: Frequent build and test Begin with high risk use cases Re
![Page 5: State Machine Diagram](https://reader036.fdocuments.us/reader036/viewer/2022062501/5681624b550346895dd28f8f/html5/thumbnails/5.jpg)
5
Advantages of Object Technology: Re-use of components Stability
Interchangeable parts Reliability
Reduced complexity of individual components Integrity
Protected data and code Iterative modeling
![Page 6: State Machine Diagram](https://reader036.fdocuments.us/reader036/viewer/2022062501/5681624b550346895dd28f8f/html5/thumbnails/6.jpg)
6
Object Behaviour:
All objects have a “state” An object has a value for each of its attributes Each possible assignment of values to an attribute
is a STATE.
![Page 7: State Machine Diagram](https://reader036.fdocuments.us/reader036/viewer/2022062501/5681624b550346895dd28f8f/html5/thumbnails/7.jpg)
7
![Page 8: State Machine Diagram](https://reader036.fdocuments.us/reader036/viewer/2022062501/5681624b550346895dd28f8f/html5/thumbnails/8.jpg)
8
State Charts:
![Page 9: State Machine Diagram](https://reader036.fdocuments.us/reader036/viewer/2022062501/5681624b550346895dd28f8f/html5/thumbnails/9.jpg)
9
Invoice States: You usually start with an UNPAID account Some luck guy will pay the FULL amount
outstanding, arriving at a state of fully paid Some like us will pay instalments for a few
months, till we pay-off the debt
![Page 10: State Machine Diagram](https://reader036.fdocuments.us/reader036/viewer/2022062501/5681624b550346895dd28f8f/html5/thumbnails/10.jpg)
10
Behavior of Object: How do we MODEL this ‘change of state’?
Identify the states Identify the transitions from state to state There are more……let’s eat the elephant bone by
bone!
![Page 11: State Machine Diagram](https://reader036.fdocuments.us/reader036/viewer/2022062501/5681624b550346895dd28f8f/html5/thumbnails/11.jpg)
11
Identify all the possible states:
![Page 12: State Machine Diagram](https://reader036.fdocuments.us/reader036/viewer/2022062501/5681624b550346895dd28f8f/html5/thumbnails/12.jpg)
12
![Page 13: State Machine Diagram](https://reader036.fdocuments.us/reader036/viewer/2022062501/5681624b550346895dd28f8f/html5/thumbnails/13.jpg)
13
![Page 14: State Machine Diagram](https://reader036.fdocuments.us/reader036/viewer/2022062501/5681624b550346895dd28f8f/html5/thumbnails/14.jpg)
14
Transitions: A transition consists of THREE parts:
Event, [guard], /action A transition is the movement from one state
to another States are either “on” or “off” at a given point
in time If a state is ON, then transitions are enabled Transitions are triggered by EVENTS
![Page 15: State Machine Diagram](https://reader036.fdocuments.us/reader036/viewer/2022062501/5681624b550346895dd28f8f/html5/thumbnails/15.jpg)
15
Event [guard / action A guard is a Boolean condition that must be
TRUE in order for a transition to “fire” When an event occurs the guard conditions
are checked, and if they are met, then the transition FIRES.
An action is a procedural expression to be performed when the transition fires
![Page 16: State Machine Diagram](https://reader036.fdocuments.us/reader036/viewer/2022062501/5681624b550346895dd28f8f/html5/thumbnails/16.jpg)
16
![Page 17: State Machine Diagram](https://reader036.fdocuments.us/reader036/viewer/2022062501/5681624b550346895dd28f8f/html5/thumbnails/17.jpg)
17
Identify ALL StatesState Transition/event State
![Page 18: State Machine Diagram](https://reader036.fdocuments.us/reader036/viewer/2022062501/5681624b550346895dd28f8f/html5/thumbnails/18.jpg)
18
StatesState Transition/event StateSpace available Add student Full
Full Close Enrollment Final,Arhive
Space available Remove student Space available
![Page 19: State Machine Diagram](https://reader036.fdocuments.us/reader036/viewer/2022062501/5681624b550346895dd28f8f/html5/thumbnails/19.jpg)
19
![Page 20: State Machine Diagram](https://reader036.fdocuments.us/reader036/viewer/2022062501/5681624b550346895dd28f8f/html5/thumbnails/20.jpg)
20
Super States A state can be nested:
A super state consists of more than one state A super state make it possible to view a state
diagram at different levels of abstraction
![Page 21: State Machine Diagram](https://reader036.fdocuments.us/reader036/viewer/2022062501/5681624b550346895dd28f8f/html5/thumbnails/21.jpg)
21
“OR” super state When the super state is ON, only one of its
sub states is ON
![Page 22: State Machine Diagram](https://reader036.fdocuments.us/reader036/viewer/2022062501/5681624b550346895dd28f8f/html5/thumbnails/22.jpg)
22
“AND” super state “Concurrent sub states”: When the super
state is ON, all of its states are also ON
![Page 23: State Machine Diagram](https://reader036.fdocuments.us/reader036/viewer/2022062501/5681624b550346895dd28f8f/html5/thumbnails/23.jpg)
23
Discuss!!
![Page 24: State Machine Diagram](https://reader036.fdocuments.us/reader036/viewer/2022062501/5681624b550346895dd28f8f/html5/thumbnails/24.jpg)
24
Exercise
![Page 25: State Machine Diagram](https://reader036.fdocuments.us/reader036/viewer/2022062501/5681624b550346895dd28f8f/html5/thumbnails/25.jpg)
25
Video RentalState Transition/Event State
![Page 26: State Machine Diagram](https://reader036.fdocuments.us/reader036/viewer/2022062501/5681624b550346895dd28f8f/html5/thumbnails/26.jpg)
26
Summary Object Oriented Analysis and development
provides a way to define and model a system A development methodology combines software
engineering processes and OOAD modeling But…..
There is a steep learning curve. You must be prepared to exercise this method several times before you begin to become proficient!
![Page 27: State Machine Diagram](https://reader036.fdocuments.us/reader036/viewer/2022062501/5681624b550346895dd28f8f/html5/thumbnails/27.jpg)
27
![Page 28: State Machine Diagram](https://reader036.fdocuments.us/reader036/viewer/2022062501/5681624b550346895dd28f8f/html5/thumbnails/28.jpg)
28
Homework Read: Page 122 – 132 Study: page 129 – 130, Sale Item diagram Page 136, No 7