Re:Is Model-View-Controller dead on the front end?
by blowski on Friday November 11, 2016 @07:00AM
(#12929869)
I agree completely. If you model is echoing long bits of HTML, or your views contain lots of SQL, that's not really MVC. Almost everything is just details. We get excited about labelling them as 'ADR' or 'MVVM' but they are all just variations on a theme.
Perhaps the problem is that rules like 'no SQL in your views' is now so ingrained, a lot of juniors have never seen a monolothic mess of SQL mixed with HTML. So MVC is almost ubiquitous, and we then try breaking it down into different sub-categories.
Re:Is Model-View-Controller dead on the front end?
by at-fates-hands on Friday November 11, 2016 @10:11AM
(#12931285)
>> SQL mixed with HTML
And now we have Javascript being mixed with HTML; which I never thought would happen.
Re:Is Model-View-Controller dead on the front end?
by simplify on Friday November 11, 2016 @10:30AM
(#12931445)
JavaScript isn't a type of logic, it's a language. You wouldn't say JavaScript is the M in MVC, for example. If you have JS in HTML, and that JS code is strictly view logic, then your code still has a clear and useful separation of responsibilities.
Re:Is Model-View-Controller dead on the front end?
by mikewhy on Friday November 11, 2016 @10:38AM
(#12931543)
> now we have Javascript being mixed with HTML
Now we have JavaScript mixed with an HTML-like syntax.
Re:Is Model-View-Controller dead on the front end?
by kensign on Saturday November 12, 2016 @04:21AM
(#12937199)
It's funny how this anti-pattern like has become so widely accepted.
Re:Is Model-View-Controller dead on the front end?
by paulddraper on Friday November 11, 2016 @10:24PM
(#12936433)
So...according to your definition MVC == encapsulation ?
The point is to not munge all these things into one monolithic horrible grim mess. As long as you are separating the concerns of showing something to a user, allowing them to control it and backing it all with potentially remote service who cares what the pattern is precisely called? Its still flavours of this original desire that we named MVC.
All these presenter/unidirectional patterns are _just_ the underlying desire of MVC and the only reason that people seem to talk about how "MVC isn't right" or "is dead" is because they've followed MVC like dogma instead of just a guideline of separating your presentation, control and service logic. I had exactly this debate back when everyone was talking about MVP as if it was some revolutionary new thing. Its not, its all the same thing and GOF was never supposed to be a template for software but a way of talking about specific ideas that architects could then riff on. They're chords, not one specific tune that you _must_ play in a very specific way.