The Lurker

Latest posts | Archive

posted by ajf on 2007-08-02 at 01:01 am

Because it's hard work to write clearly and precisely, I've been waiting for years now for somebody other than me to write up an explanation of what is commonly called "MVC" in web application frameworks is basically completely unrelated to MVC as in the original Smalltalk sense.

(I got as far as coming up with "Model, View, Bunk" as the post title, and quoting from pages 4–6 in the introductory chapter of Design Patterns, which highlights the key design patterns in Smalltalk MVC, and contrasting that with web framework "MVC", which is built upon none of those patterns and resembles MVC only insofar as it has a component called "model", a component called "view", and, well, I guess we'll just call some of the other bits "controller" so we can hijack the name; and, inspired by Martin Fowler's attempt to introduce the term "dependency injection" to specifically identify that concept and distinguish it from the term "inversion of control" which people had been using to talk about it, deciding to come up with an alternative name for what the principal components of web framework "MVC" should really be called, for which I'd come up with a tentative, uninspiring proposal in "Action, State, Template".

See how long that sentence is? Writing that more clearly would be much more effort, as Blaise Pascal, Mark Twain, Henry Thoreau, St Augustine and Cicero are all claimed to have wisecracked. It has taken me half an hour to write this introduction to a link as it is. Well, I started half an hour ago. That's not quite the same thing.)

Anyway, it hasn't happened yet, but at least somebody seems to share my opinion on the subject: on Tim Bray's blog where he writes about web frameworks which mis-abstract the web, Simon Willison tells a sad story about Django and the "MVC" label:

We used to avoid describing Django as MVC because it simply didn't mesh with our understanding of the MVC design pattern. In classic MVC, the controller is this magic piece of code that keeps the view and model in sync. The way the term controller is used for Web frameworks just didn't seem right to us. [...] Of course that just led to people criticising Django as "not MVC", which was ridiculous. So these days we tend to just call it MVC and put up with the discomfort.

Sigh.

Related topics: Rants Web Mindless Link Propagation

All timestamps are Melbourne time.