-
-
Notifications
You must be signed in to change notification settings - Fork 2
Convention Guide
Fahmi Akbar Wildana edited this page May 31, 2019
·
13 revisions
When designing a State Machine, you need to know the purpose. Each State Machine has a slightly different convention.
- When the element name of the State Machine similar to each other:
- Rename the state as past tense when it has the same name as the event. However, try to avoid this because not all world languages have a past tense verb
- For the event name, the name must answer this question:
- What is the event? (Answer: pay)
- How to trigger it? (Answer: by clicking the button or hit the enter key)
- Use Protocol Transition when you want to explain the lifecycle of some states
- Always think about how the system can recover from failure
- Usually, they use self (loop) and backward transition to recover from failure
- Use Protocol Transition when you want to explain the lifecycle of some processes
- use Behaviour Tree (HSFM vs Behaviour Tree) or
- shape it as acyclic graph (no self or backward transition)
- utilize State Management library or
- rely heavily on invoking/spawning services, calling actions, and assigning context