thoughts on mvc

Apr 15, 2005 23:00

(( this is a crosspost from plix.org ))

I've been doing some reading up on the MVC paradigm, a result of my recent research of ruby on rails. It's something I've toyed around with a lot over the past few years, but never really looked at seriously until now. I suppose that my aversion to it was primarily my bias towards Java and my rather short-sighted belief that the MVC paradigm was primarily a Java methodology.

However, after a good deal of thought, I've concluded that generally MVC does not apply well to something as specific as hydrogen. I think furthermore that it's a poor choice for developing blog software for the simple reason that it doesn't map well to something that specific where the one and only controller would be the blog controller. It's simply over-kill.

However, I believe MVC would excell as basis for the development of a true, complete, and industrial-strength CMS (a la mambo or Bricolage, not faux-CMS packages such as Movable Type and the other blog-only packages). In web-based technologies the majority of the code is going to exist in the controller layer of the system. The controller is going to be little more than a .htaccess file and a module loader and the view is nothing more than an HTML templating engine such as Mason. As such, the model is the workhorse. This enormous depth of abstraction is unnecessary unless there exists at least several different models. Personally, I see the need for multiple models only when there are multiple, distinct areas of the site. For example, a blog, file database, and photo album which are all part of one codebase for a site should each be implemented as a different controller. This also makes a plug-in architecture much cleaner and straight-forward since the only hooks that are required are links in the webpage (the view) that trigger a particular model (obviously via the controller, even though the amount of work done is painfully trivial).
Previous post Next post
Up