Project is a good candidate to use state machine if:
-
Application or part of its structure can be represented as states.
-
You want to split complex logic into smaller manageable tasks.
-
Application is already suffering concurrency issues with i.e.
something happening asynchronously.
You are already trying to implement a state machine if:
-
Use of boolean flags or enums to model situations.
-
Having variables which only have meaning for some part of your
application lifecycle.
-
Looping through if/else structure and checking if particular flag or
enum is set and then making further exceptions what to do when certain
combination of your flags and enums exists or doesn’t exist together.