1 / 11

Chapter 29

Chapter 29. State Machine Diagrams. State Machine Diagrams. They show a dynamic view, the interactions between states of an object and reaction to events. Event. A significant or noteworthy occurrence A telephone is taken off-hook A key is pressed on a keyboard A door is opened

bruno
Download Presentation

Chapter 29

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Chapter 29 State Machine Diagrams CS6359 Fall 2011 John Cole

  2. State Machine Diagrams • They show a dynamic view, the interactions between states of an object and reaction to events. CS6359 Fall 2012 John Cole

  3. Event • A significant or noteworthy occurrence • A telephone is taken off-hook • A key is pressed on a keyboard • A door is opened • A quarter is put into a vending machine CS6359 Fall 2011 John Cole

  4. Transition • Relationship between two states that indicates that when an event occurs, the object moves from the prior state to the subsequent state. • When off-hook occurs, transition from Idle to Active state CS6359 Fall 2011 John Cole

  5. Applying the Diagrams • If an object always responds the same way to an event, it is state-independent or modeless. • State-dependent objects react differently to messages depending upon their state. • A telephone is very state-dependent. Its response to pushing buttons depends whether it is on-hook or off-hook and whether there is an ongoing call or not. CS6359 Fall 2011 John Cole

  6. When to Use • Consider state machines and diagrams for complex, state-dependent objects, not for state-independent objects. • Business information systems seldom have much state-dependent behavior (although the UI may have some) • Process control, device control, and telecom have many state-dependent objects CS6359 Fall 2011 John Cole

  7. Modeling State-Dependent Objects • State machines applied in 2 ways: • Model the behavior of a complex reactive object in response to events • Model legal sequences of operations such as protocol or language specifications. A formal grammar is a kind of state machine CS6359 Fall 2011 John Cole

  8. Complex Reactive Objects • Physical devices • Transactions between related business objects. How does sale, order or payment react to an event? • Role mutators are objects that change roles based upon events. Person changes from civilian to veteran. City changes from destination to origin. CS6359 Fall 2011 John Cole

  9. Protocols • TCP can be understood with a state machine diagram • UI page/window flow or navigation • UI flow controllers or sessions • Use case system operations • Individual UI event handling CS6359 Fall 2011 John Cole

  10. Transition Actions and Guards • Transition can cause an action. This may be invocation of a method. Transition may also have a test and it occurs only if the test passes. CS6359 Fall 2011 John Cole

  11. Nested States • States can have substates which inherit the transitions of the superstate. CS6359 Fall 2011 John Cole

More Related