News for hackers. Stuff that matters.
Re:Rails is not MVC by zzzeek on Sunday September 25, 2011 @10:53AM (#3035878)
practicality beats purity, even though the Python frameworks are moving away from the "MVC" term it always felt like "MVC" to me, in that there are three distinct components - data objects (model), some kind of "load the model in response to a URL and display a template" (controller, what better name is there, I think "view" is a crappy name for that since it doesn't define presentation), then the "template", seems like a view to me - it's the thing you're viewing!

That the model isn't notifying the view through an event system is splitting hairs. The GOF book is much maligned I think because people insist on taking each pattern completely literally down to the last detail. GOF's pattern (GOF didn't create it but they discuss it on page 4, I thought I was crazy until I just checked just now) is specifically "MVC, and because we only know about C++^H^H^H Smalltalk graphical libraries and not very much about stateless HTTP systems yet in 1993, the model notifies the view of changes too, how else would it work ?" IMHO. It's an implementation detail, it's not the essence of the pattern.

So if a JS framework is now doing MVC that includes the concept of "model notifies the view", sure call it "classical MVC" or "model-notify-view-controller" (MNVC). Shrugs.

Re:Rails is not MVC by sunchild on Sunday September 25, 2011 @11:17AM (#3035918)
Exactly. OP offers a great article and commentary, and then arrives at the completely wrong conclusion. Like it or not, MVC is in the vernacular now, and it means any framework organized in model-view-controller structure – regardless of whether the app has stateful views.

A better conclusion perhaps would be to distinguish "stateful MVC" from "stateless MVC"?

Re:Rails is not MVC by mcdonc on Sunday September 25, 2011 @06:43PM (#3036935)
It's not splitting hairs at all. It's the definition of the pattern. The pattern was created for stateful UI systems, and it can't be emulated with request-response frameworks without UI state kept on the client side.

But that said, the fact that Rails (and Pylons, etc) called themselves MVC has rendered any definition meaningless, so it just kind of doesn't matter. Truth be told, it was already getting there long before web frameworks entered the picture when Java coopted the term to mean something it didn't in the 90s.

I prefer to use different terminology to avoid confusion, but if you wanna keep using "MVC" for your own stuff, I'm not going to fight city hall.

Re:Rails is not MVC by endtime on Sunday September 25, 2011 @02:32PM (#3036399)
>I think "view" is a crappy name for that since it doesn't define presentation

http://en.wikipedia.org/wiki/View_(database)

Re:Rails is not MVC by zzzeek on Sunday September 25, 2011 @02:50PM (#3036440)
the "controller" in MVC is specifically tasked with responding to user input and persisting those changes into the model. So it's nothing like a database view either, which is traditionally read-only. Like a database view, a template organizes information from disparate sources into a particular presentational configuration - just at different levels of the stack. IMHO they are roughly analogous.
Re:Rails is not MVC by endtime on Sunday September 25, 2011 @03:12PM (#3036494)
It's different, but it's not "nothing like it". I was explaining where the term comes from, since you didn't seem to know.
Re:Rails is not MVC by zzzeek on Sunday September 25, 2011 @05:29PM (#3036786)
I'm familiar with database views, thanks.

Wikipedia credits Trygve Reenskaug with inventing the term "model-view-controller", he was a Smalltalk guy with Xerox at that time - I don't think there's any relation in the origin of that terminology to the notion of a "database view" - otherwise not sure what you're referring to here (here's a link to the original paper: http://st-www.cs.illinois.edu/users/smarch/st-docs/mvc.html)

Re:Rails is not MVC by petersabaini on Sunday September 25, 2011 @03:32PM (#3036543)
The downside of muddying the definition of MVC is that it hinders communication about other design patterns that may actually make more sense for web applications, eg. Model-View-Presenter / Passive View

(Edit: if one cares about design patterns at all, that is. Otherwise it makes perfect sense to use MVC as the marketing term it has become and do whatever)