2 ms·
For example an ecommerce order tracking system with different status (in cart, paid, shipped, returned, so on). Spree solves it very elegantly, look at those "
by pantulis 6y ago
For example an ecommerce order tracking system with different status (in cart, paid, shipped, returned, so on). Spree solves it very elegantly, look at those "events", "transitions".
https://github.com/spree/spree/blob/4687e608b49236c2850500b026a9fbbab37dc96c/core/app/models/spree/shipment.rb https://github.com/spree/spree/blob/4687e608b49236c2850500b0...
Also, Spree has this nice intro to FSMs
https://github.com/Humane-Documentation/Spree/blob/master/related/state_machine.md https://github.com/Humane-Documentation/Spree/blob/master/re...
- pantulis 6y agoI also happened to work in a very huge C++ project for the business logic component of a call center, using CORBA and the Reactor pattern from ACE to integrate different parts of the user / ACD / 1st agent / specialist / CTI combo. But it was a telco project, so the "let's use a FSM" was well thought from the beginning. Turns out you could easily know what the system would do just by reading a huge Smartdraw document, and this also allowed for reasoning on new use case scenarios. It did not matter that the main file was a horrendous 40kLOC C++ class because the Smartdraw diagram was the documentation and everything else was just trivial code.