No more MVC
dev.to
dev.to
There's nothing new here other than renaming.
I find this useful because it allows you to reuse a controller (action). In most applications you'll have at least 2 views on the system: UI and API. Sometimes, they're the same, but very often they're not.
I don't doubt that the pattern is useful for web sites and services, it just looks like plain old MVC to me and thus not meriting a new name.
I'm not sure that would be a problem, but it was kind of undefined as to what other responsibilities the controller would have.
I now pretty exclusively use statically typed backends with js frontends. This gives me stability where I need it, and rapid development where I need it.
It's really still MVC, but the V got bigger and has been separated from the M and C. MC-V?
1. As single, immutable, source of truth (The Store)
2. Unidirectional data flow
3. Clear separation of concerts (views, actions, reducers,
the store).
You could stop there and create a nice little diagram, but you need to go further to get the actual benefits. 4. Functional programming (eschew OOP)
5. Higher Order Components (or render prop)
6. Forget DRY, favour simplicity over abstraction
7. Selectors
8. Proper control over side effects (see Redux Sagas)
9. Container components and presentational components.
You could still draw a diagram, but it wouldn't be the nice, neat, three box diagram people seem to love so much.Redux is really only viable for Javascript at the moment, but I think it would be an approach worth using elsewhere. Sadly, the model part is hard to get right in compiled, statically typed languages.
I'd add to this, I think a thoughtful approach to a redux architecture negates the need for typed Javascript. When your code is functional, your functions are small, your concerns are properly separated, you side effects are wrangled and you state is under total control, Typescript and Flow just make things complicated again.
The boundary lines between the Model, View, and Controller always tended to be a bit fuzzy (with each technology providing their own interpretation of it).
I'm alright with a clarifying name change. But it certainly doesn't mean that MVC is "dead".
Does it need to?