Extract the state machines into replaceable modules #3356
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR extracts the existing state machines into replaceable modules.
A while ago I took ownership of some PRs that completely removes the state machines from a few models (#3038, #3039, #3040, #3041).
While I fully agree with the rationale behind those PRs, I think that rewriting manually each dynamically generated
state_machines
's method might not be ideal.AFAIK, the state machines in these models don't need to be customized for the majority of the shops (please correct me). Also, having different state-related logic implementations for different models could be confusing.
By discussing this a bit with @kennyadsl, we thought that it might be worth introducing first an intermediary step that lets developers tinker more easily with the existing state machines instead of removing them completely.
This will enable the (few?) shops which require a custom state-related logic to provide their own while keeping a standard implementation for the rest. Hopefully, it could also lead to more ideas 馃挕addressing the concerns in the original PR (#3038).
Checklist: