4 ms·
This is what bugs me about state machines (like https://github.com/pluginaweek/state_machine https://github.com/pluginaweek/state_machine). Adding a history or
by joevandyk 15y ago
This is what bugs me about state machines (like https://github.com/pluginaweek/state_machine https://github.com/pluginaweek/state_machine).
Adding a history or audit always seems like a giant hack.
- hashbo 15y agoActually a history on a state machine give’s you undo functionality a fairly common pattern, no? You have a stack of states instead of a single state. Trouble is though inter-related states isn’t it :-) things can get messy if you don’t have atomic states. Actually someone else just pointed me in the direction of Event Sourcing - every pattern has a name somewhere - http://martinfowler.com/eaaDev/EventSourcing.html http://martinfowler.com/eaaDev/EventSourcing.html
- jchrisa 15y agoThere is a lot of complexity in that Event Sourcing document. The pattern can be simpler: https://github.com/iriscouch/follow/blob/master/README.md https://github.com/iriscouch/follow/blob/master/README.md