290 likes | 613 Views
State Machine Diagram. Chapter 5. Additional notes: Notes I picked-up on the Internet: University of Toronto, Craig D Wilson (Matincor, Inc.). Revision: (World View) . Use Case Fully Descriptive Use Case Activity Diagram Domain Model Diagram SSD State Machine Diagram
E N D
State Machine Diagram Chapter 5 Additional notes: Notes I picked-up on the Internet: University of Toronto, Craig D Wilson (Matincor, Inc.)
Revision: (World View) • Use Case • Fully Descriptive Use Case • Activity Diagram • Domain Model Diagram • SSD • State Machine Diagram • Component Diagrams • Deployment Diagrams Next Semester
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
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
Advantages of Object Technology: • Re-use of components • Stability • Interchangeable parts • Reliability • Reduced complexity of individual components • Integrity • Protected data and code • Iterative modeling
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.
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
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!
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
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
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
“OR” super state • When the super state is ON, only one of its sub states is ON
“AND” super state • “Concurrent sub states”: When the super state is ON, all of its states are also ON
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!
Homework • Read: Page 122 – 132 • Study: page 129 – 130, Sale Item diagram • Page 136, No 7