Re:Finite State Machines
by jgraettinger1 on Monday February 22, 2021 @09:32AM
(#26224944)
> My opinion is that FSMs are best implemented on a higher abstraction layer than directly in code itself.
I really love Rust async/await for this. Under the hood, the compiler is simply assembling a big FSM, and polling a Future is equivalent stepping through allowed transitions which are available to it.
You can even use this to build FSMs which are designed to be manually driven, by coordinating generator inputs and outputs via RefCell and one-shot channels and calling `poll` yourself.
Re:Finite State Machines
by tenaciousDaniel on Monday February 22, 2021 @09:16AM
(#26224770)
Seems like FSM and DDD would go very well together, although I haven't seen any literature explicitly linking the two.
My opinion is that FSMs are best implemented on a higher abstraction layer than directly in code itself. FSMs tend to reflect the business domain very closely, are very easy to reason and talk about with non-tech domain experts but also tend to change often. Therefore we have always implemented the framework for the FSM along with some kind of event kernel, and then left the actual setup and configuration of the FSMs to a configuration layer.
It has worked very well and has made it so much easier to talk about how the system works with non-techies.