Chapter 8. Statechart Diagrams
State machine diagrams capture the behavior of a software system. State machines can be used to model the behavior of a class, subsystem, or entire application. They also provide an excellent way of modeling communications that occur with external entities via a protocol or event-based system.
UML has two types of state machines:
- Behavioral state machines
Show the behavior of model elements such as objects. A behavioral state machine represents a specific implementation of an element.
- Protocol state machines
Show the behavior of a protocol. Protocol state machines show how participants may trigger changes in a protocol’s state and the corresponding changes in the system (i.e., the new state of the protocol). Protocol state machines aren’t typically tied to a particular implementation, and they show the required protocol behavior.
Behavioral and protocol state machines share common elements; however, protocol state machines are not tied to an implementation and have restrictions on their transitions. Because protocol state machines are a specialization of behavioral state machines , this chapter first discusses behavioral state machines and other topics common to all state machine diagrams; then details of protocol state machines are explained.
Behavioral State Machines
State machines represent the behavior of a piece of a system using graph notation. A state machine is shown using the basic rectangle notation, with the name of the state machine ...