Knowing Your State Machines
summary
Explains how to model domain logic as state machines using the Symfony Workflow component and the classic state pattern, with concrete code for can/apply methods, YAML workflow config and a Chrome command that drives email nudges; demos include a job-advert workflow, traffic-light and multi-step form, and a CRM migration. Notes more than 21 events fired per transition and the usefulness of the guard event for authorization; configuration changes update UI behavior (buttons) without changing controllers.
AI-written summary · about
chapters (14)
- 0:00Introduction to state machines
- 1:06Speaker introduction and background
- 2:34Graph theory basics and state machines
- 7:18State machine examples in real life
- 10:05State pattern vs Mealy state machine
- 14:20Implementing a traffic light state machine
- 18:38Symfony Workflow component overview
- 22:05Job advert workflow in code
- 23:32State machine vs workflow differences
- 25:20Workflow events and guard conditions
- 28:13Debugging and domain-specific workflows
- 30:30Visualizing workflows with Graphviz
- 30:52When to use state machines
- 32:32Resources and Q&A
