Knowing your state machines
summary
Explains that state machines are simple directed graphs and shows concrete implementations: a Cron-driven email reminder using the state pattern versus a single-rule Mealy-style machine, a traffic light, job advert and PR workflows, multi-step forms and elevator doors. Uses the Symfony Workflow component (marking store, can/apply/transition, dumping to Graphviz) and hooks via the event dispatcher and guard events (about 21 events total). Demonstrates stateless rules-by-configuration and when to persist current state.
AI-written summary · about
chapters (13)
- 0:00Intro
- 0:38State machines
- 2:30Graph theory
- 5:15Graph constraints
- 12:02The state pattern
- 16:30Implementing the traffic light
- 22:02The workflow component
- 27:30Workflow vs state machine
- 29:37Event dispatcher
- 31:06Guard events
- 33:07Business logic
- 33:47In configuration
- 35:49Summary
related talks
19mIntroducing state machines and statecharts
28mState machines for frontend state management
37mState Machine: What It Is and Why
43m.NET: State Machine in Practice
37mReactive State Machines and Statecharts
44mManaging Complex Application State with Finite-State Machines
28msetState Machine
29mCrafting Stateful Styles with State Machines
