May 21st

Model-View-Controller

A quick explanation of exactly what the model-view-controller is.

Howdy!

This is my first post and I’d thought I’d start with something that I’ve written before and (hopefully) I sounded intelligent then – this is an extract from my thesis in my final year of college. A short piece on the Model-View-Controller.

So what is it? Here’s the part you use on the exam paper.

MVC (or Model-View-Controller) is a standard principal used in developing Web Applications. The Model is your database (storing information), the Controller is your code logic (preforming calculations),  and the View is the presentation layer (the output of the calculation).

And now here’s to part for the non-technical person

Let’s consider the analogy  of a restaurant. After the hungry customer places an order, the food is taken out of the freezer, cooked, by the chef, and then delivered, by a waitress.

In this case, the restaurant is the Internet, the food ordered is the data requested (a web page, for example), the freezer is the model layer (database); the chef is the controller (processes the data) and the waitress bringing the food to the table is the view layer bring the information to the screen.

There is a clear distinction between the view layer and the controller layer because, although the application will work fine, it’ll be like having the waitress acting as the chef – she’ll still deliver your food but chances are it’ll be half-baked!

oh what a witty ending – better every time I write it.

Leave a Reply

Now you've seen what we can do, see what we can do for you