Benefits of using state machines (FSMs)
- They are used to describe situations or scenarios of your application (Modelling the life cycle of a reactive object through interconnections of states).
- FSMs are helpful to model complex applications that involve lots of decision-making, producing different outputs (actions), and processing various events.
- State machines are visualized through state machine diagrams in the form of state charts, which helps to communicate between non-developers and developers.
- Makes it easier to visualize and implement the changes to the behavior of the project.
- Complex application can be visualized as a collection of different states processing a fixed set of events and producing a fixed set of outputs.
- Loose coupling: An application can be divided into multiple behaviors or state machines, and each unit can be tested separately or could be reused in other applications.
- Scalable
- Narrow down whole application complexity to state level complexity, analyze and implement.