Closed charlierudolph closed 10 years ago
Thanks @charlierudolph, yes please move forward with this. It's been on our list for a while to make StateMachine know a lot less about Transitions. Pretty much all of the relevant logic in the gem in encapsulated in the StateMachine class.
I like the idea of a TransitionConfiguration class that has the relevant info about the guards, concluders, etc. And then a Transition class that would take over a lot of the logic wrapped up inside StateMachine.
Ideally you can do this as a pure refactor and not have any changes to the API. If you do find you need to change the API, please call it out clearly.
I'd like to do a number of things around Transition.
I was about to create a PR with the following
In doing so I came up with another change I would like to implement
I think this will help move a lot of transition logic out of the state machine and into its own class. Didn't create a PR for the current work as if you agree, TransitionConfiguration becomes quite different.