Defining criteria for the state management pattern
When selecting the most suitable pattern, there can be many criteria and it may vary from person to person. There will never be a situation when the whole world agrees on one specific pattern. Nevertheless, here are some important points that I believe hold a general appeal:
- The business logic should be independent of the UI logic and should be clearly separated.
- The pattern should be used consistently.
- At the same time, the pattern should be scalable and flexible.
- It should be comprehensible to the team. This criteria may be often overlooked as non-important, but in the end, the software is developed by people and the more effectively they can work with the pattern, the more productive the output will be.
- The pattern should complement the framework it is being used in, not work against it.
Some of the implementations of the MVC pattern violate these criteria:
- Specifically in that implementation...