Hints and Tips
When you create state diagrams in the UML, remember that every state diagram is just a projection on the same model of a system's dynamic aspects. A single state diagram can capture the semantics of a single reactive object, but no one state diagram can capture the semantics of an entire nontrivial system.A well-structured state diagram
- Is focused on communicating one aspect of a system's dynamics.
- Contains only those elements essential to understanding that aspect.
- Provides detail consistent with its level of abstraction (expose only those features that are essential to understanding).
- Uses a balance between the styles of Mealy and Moore machines.
When you draw a state diagram,
- Give it a name that communicates its purpose.
- Start with modeling the stable states of the object, then follow with modeling the legal transitions from state to state. Address branching, concurrency, and object flow as secondary considerations, possibly in separate diagrams.
- Lay out its elements to minimize lines that cross.
- For large state diagrams, consider advanced features such as submachines that are included in the full UML specification.