State machine diagrams were covered as part of the Software Engineering module (COM00144M) during my MSc studies with the University of York. This post will detail my findings and provide information and examples on how to create state machine diagrams.
What is a state machine diagram?
State machine diagrams are used to model the events an object can go through. They visualise the steps of a process and show the different paths that can be taken from one state to another during its lifetime.
Each state is shown by a single rounded rectangle, the name of the state is written inside.
States can contain further optional detail in the form of these additional properties:
- Entry – An action that is performed on entry to the state
- Do – An action that is performed while in the state
- Exit – An action that is performed on exit of the state
- Defer – An action that occurs when the current state is exited and triggered from another state