A state of Mind
summary
Demo shows that using the state design pattern makes domain rules explicit, testable and located in one place. A small XML state-machine (pending, accepted, paid, shipped, rejected, closed) generates PHP code, Graphviz diagrams and PHPUnit tests so transitions and query methods are created automatically. Codegen produces readable classes and executable specs from the same source; it works as a proof of concept on GitHub but remains unproven in a full production app.
AI-written summary · about
