Live data from Hacker News

MVC is dead, it's time to MOVE on

cirw.in

101–110 of 233 posts

Re: MVC is dead, it's time to MOVE on

#101
post #96
post #83

Earlier quoted context omitted.

my rails apps pass this test with flying colors. Nearly all of my end points have at least 3 views. 1 for html, 1 for json (often used for ajax calls), and 1 for rss/atom.

JSON and RSS views don't make sense - in MVC, views are visual representations of data (the model). Views are how the user percieves the application. JSON and RSS are just different methods for representing data to be communicated to other systems.

Users are not necessarily human - they can be search engines, API consumers, etc.

Re: MVC is dead, it's time to MOVE on

#102
I'm going to go out on a limb here.

With a pattern like MVC, where developers implement it again and again, and many of these are junior devs, it's highly likely that people who don't entirely understand the pattern are going to be adding code. The correct use of the pattern is going to get diluted, and certain classes are going to get overstuffed with code that often turns into spaghetti code.

I'm not so sure this is the fault of the junior developers. If there is one "obvious" place to expediently stuff code to implement new functionality then this is actually the fault of original designers. I don't know of any pattern for building applications that doesn't fall into this trap, but I think that one which escapes it is possible through some trick of code organization and programming language technology.

Re: MVC is dead, it's time to MOVE on

#103
post #96
post #83

Earlier quoted context omitted.

my rails apps pass this test with flying colors. Nearly all of my end points have at least 3 views. 1 for html, 1 for json (often used for ajax calls), and 1 for rss/atom.

JSON and RSS views don't make sense - in MVC, views are visual representations of data (the model). Views are how the user percieves the application. JSON and RSS are just different methods for representing data to be communicated to other systems.

> JSON and RSS are just different methods for representing data to be communicated to other systems.

We call those, "views".

Re: MVC is dead, it's time to MOVE on

#104
post #82

MVC, more than other design patterns, is horribly abused. Developers should keep in mind its GUI roots. Here's my "is it MVC?" litmus test: How much of my code survives if I drastically change the view? For example, if I want to switch to a new desktop, web or text console interface, can I reuse much of the application? Of course, architecture changes this significantly (particularly web architecture), but still, if…

I remember the first time I heard of MVC in a web context, almost 15 years ago. (ffs). I did what I normally did and looked it up and totally struggled with how an approach that seemed to be focused on device input would map to a web framework. After working with a few "MVC" frameworks I completely gave up on mapping what they called MVC to what I thought MVC was (which was based on a pretty old definition at that point). When I finally started using Rails I finally found a framework where at least the M,V&C were pretty clearly defined, though not in the context I thought they should be according to the pattern.

Anyway long story short. I don't think the pattern is abused anywhere near as much as the term as been.

Re: MVC is dead, it's time to MOVE on

#105
post #96
post #83

Earlier quoted context omitted.

my rails apps pass this test with flying colors. Nearly all of my end points have at least 3 views. 1 for html, 1 for json (often used for ajax calls), and 1 for rss/atom.

JSON and RSS views don't make sense - in MVC, views are visual representations of data (the model). Views are how the user percieves the application. JSON and RSS are just different methods for representing data to be communicated to other systems.

[deleted]

Re: MVC is dead, it's time to MOVE on

#106
post #96

Earlier quoted context omitted.

JSON and RSS views don't make sense - in MVC, views are visual representations of data (the model). Views are how the user percieves the application. JSON and RSS are just different methods for representing data to be communicated to other systems.

Users are not necessarily human - they can be search engines, API consumers, etc.

In the context of MVC, a user is a human being - describing JSON and RSS services as "views" totally misses the point.

Quote from the inventor of MVC, Trygve Reenskaug:

"The essential purpose of MVC is to bridge the gap between the human user's mental model and the digital model that exists in the computer."

Re: MVC is dead, it's time to MOVE on

#107
post #72

If your controller has too much logic you should really consider putting more of it in your model and view. Maybe I don't understand MVC, and you all can tell me How Wrong I Am, but here's how I understand MVC at present: Your Model is a public API, a Service Gateway -- and it should do a couple of things in principle. The first is that it should be able to manage a list of subscribed view/controllers, and push updat…

Sounds about right to me. Model in MVC isn't data model, it is a model of the application domain, aka business logic. The controller is supposed to map low level input to high level model actions. The view goes the other way, high level model representation to low level operator display.

Re: MVC is dead, it's time to MOVE on

#108
post #96
post #83

Earlier quoted context omitted.

my rails apps pass this test with flying colors. Nearly all of my end points have at least 3 views. 1 for html, 1 for json (often used for ajax calls), and 1 for rss/atom.

JSON and RSS views don't make sense - in MVC, views are visual representations of data (the model). Views are how the user percieves the application. JSON and RSS are just different methods for representing data to be communicated to other systems.

"views are visual representations of data"

I see no purpose for this distinction. A view is an output representation of the model data.

Given the challenge, "How much of my code survives if I drastically change the view?", I think json and rss make perfect sense. They are drastically different output representations of the data.

Re: MVC is dead, it's time to MOVE on

#109
post #96
post #83

Earlier quoted context omitted.

my rails apps pass this test with flying colors. Nearly all of my end points have at least 3 views. 1 for html, 1 for json (often used for ajax calls), and 1 for rss/atom.

JSON and RSS views don't make sense - in MVC, views are visual representations of data (the model). Views are how the user percieves the application. JSON and RSS are just different methods for representing data to be communicated to other systems.

HTML is also one of those different methods. It just so happens that the browser renders it instead of spitting out the raw text.

That said, non-HTML output bypasses the view entirely in Rails (it makes sense to), so it can equally be the case that the distinction is correct.

Re: MVC is dead, it's time to MOVE on

#110
Show me the code. Before I believe this, I'll need to see a codebase that uses MOVE and not MVC and manages to do things which are not easy in MVC. It's find to rant and rail against old patterns, but patterns are descriptive, not prescriptive. Once you see a solution that has the same "shape" in a few different contexts, you might have found a pattern. This puts the cart before the horse by proposing the pattern before it has been actually used.
Post reply on HN