Hi @jdubray First thx for bringing the SAM pattern. I had a (very) hard time to understand the principles because I found the approach too computer-science-high-level-of-abstraction for me. I am more used to the ducks and pizzas from the gang of four :)
So, after weeks, I finally got it (at least I except to...) and it is really simple!!
Now I have a question about how to reduce the increasing number of automatic actions.
Let's take an exemple: in a MMORPG (I am building one) a player clicks on a vendor of the shop to buy something (I don't talk about model mutation for simplification here)
The problem here is that I have plenty of states which share the same context (open a panel) and are not used by the rest of the app. So I am looking for a way to encapsule this.
You say that composition of actions is OK with C(data) = B(A(data)) but is it ok to do E(data) = C(B(data),A(data)) ? In other word is it allowed to trigger a sequence of actions in the same action?
In my opinion yes because it is still one effect built with several independent effects sharing the same context. Isn't?
If yes, can generator could simplify the number of states?