„MVC and web apps: oil and water
by Harry Fuecks
Roll back the clock by two years. That’s before AJAX, before Web 2.0, before Rails. Where were we then? Well pondering whether MVC was really such a good idea after all. Continuing from there:
What is MVC?
For a long answer, the best I%u2019ve seen (for web heads) is Jeff%u2019s analysis here. There more to be found via Wikipedia and yet more on the old C2 wiki.
A short answer, for web applications (with a PHP slant), is probably a way to organise code based around the following ideas;
* Model: those functions that wrap calls to your db
* View: the templates / scripts that output HTML
* Controller: the stuff that examines variables like $_GET and $_POST and works out what to do next
What’s important to remember is there’s no absolute definition of MVC and there are many grey areas for interpretation and yet more when it comes to using it online. That in itself means, if you’re building a framework, you just need to put the words Model, View and Controller in there somewhere and you’re probably as right as anyone else. A while back John Lim dared to ask Is MVC over-designed crap?, I suspect coming for the gut instinct of an experienced programmer. In a later update he wryly commented;“