Transition Actions and Guards
A transition can cause an action to fire. In a software implementation, this may represent the invocation of a method of the class of the state machine diagram.
A transition may also have a conditional guard - or boolean test. The transition only occurs if the test passes.
Figure 29.2 Transition action and guard notation
A state allows nesting to contain substates; a substate inherits the transitions of its superstate (the enclosing state). This was a key contribution of the Harelstatechart approach that the UML is based on, as it leads to succinct state machine diagrams. Substates may be graphically shown by nesting them in a superstate box.
Figure 29.3 Nested states
For example, when a transition to the Active state occurs, creation and transition into the PlayingDialTone substate occurs. No matter what substate the object is in, if the on hook event related to the Active superstate occurs, a transition to the Idle state occurs.
Example: Ul Navigation Modeling with State Machines
Some Ul applications, especially Web Ul applications, have complex page flows. State machines are a great way to document that, for understanding, and a great way to model page flows, during creative design.
A common technique in Ul agile modeling and Ul prototyping is to model aUl with large paper sheets on walls. Each sheet represents a Web page. Post - it notes are place on the sheets to represent elements; perhaps yellow is information and pink is a control, such as a button. Each sheet is labeled, e.g., "Help Page," "Product Page," and so on.
In addition to modeling the page content with this "low tech, high touch - method, it is useful to model the flow between these pages. Therefore, on a whiteboard adjacent to the wall of Web pages, I'll sketch a UML state machine diagram. The states represent the pages and the events represent the events that cause transfer from one page to another, such as a button click. See Figure for an example of this Ulnavigation model. Of course, this small example doesn't do justice to the usefulness of the practice; it's value becomes evident for large, complex page structures.
Figure 29.4 Applying a state machine to Web page navigation modeling
Example: NextGen Use Case State Machine Diagram
There are no really interesting complex reactive objects in the case studies, so I'll illustrate a state machine diagram to show legal sequencing of use case operation. See Figure for its application to the Process Sale use case.
Figure 29.5 A sample state machine for legal sequence of use case operations
UML Related Interview Questions
|Adv Java Interview Questions||Java collections framework Interview Questions|
|Design Patterns Interview Questions||Rational robot Interview Questions|
|Web semantic Interview Questions||Spring MVC Framework Interview Questions|
|Advanced C++ Interview Questions||Advanced jQuery Interview Questions|
|XML DOM Interview Questions||Object Oriented Analysis and Design Interview Questions|
Object-oriented Analysis And Design
Iterative, Evolutionary, And Agile
Inception Is Not The Requirements Phase
Iteration 1 Basics
System 'sequence Diagrams
Requirements To Design-iteratively
Logical Architecture And Uml Package Diagrams
On To Object Design
Uml Interaction Diagrams
Uml Class Diagrams
Grasp: Designing Objects With Responsibilities
Object Design Examples With Grasp
Designing For Visibility
Mapping Designs To Code
Test - Driven Development And Refactoring
Uml Tools And Uml As Blueprint
Iteration 2 - More Patterns
Quick Analysis Update
Grasp: More Objects With Responsibilities
Applying Gof Design Patterns
Iteration 3 Intermediate Topics
Uml Activity Diagrams And Modeling
Uml State Machine Diagrams And Modeling
Relating Use Cases
Domain Model Refinement
More Ssds And Contracts
Logical Architecture Refinement
More Object Design With Gof Patterns
Designing A Persistence Framework With Patterns
Uml Deployment And Component Diagrams
Documenting Architecture: Uml & The N+1 View Model
More On Iterative Development And Agile Project Management
All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd
Wisdomjobs.com is one of the best job search sites in India.