by fortysixdegrees · 4y ago · 0 comments
[1] - https://www.crunchydata.com/products/crunchy-bridge
[2] - https://www.citusdata.com/blog/2016/08/12/state-machines-to-...
[3] - https://brandur.org/fragments/large-scale-ruby-refactoring
Full disclosure, I think I wrote my first state machine in around 1996. So yea... Grey hair etc. Also it was a big part of my computer science degree, studied formally, so perhaps that's why I'm biased in favour of them.
At some point you'll have to think about query performance on the state transition table, but it'll go further than you think and is firmly in the realm of problems of success.
This pattern is something which I've evolved over the years and it's fantastic (if I do say so myself).