Archives

Articles tagged ‘oop’

Understanding the MVC pattern

In my quest for the perfect code I’ve ran thru many tries since I’ve entered the OOP writing utility classes and even coded my own templating system with a simple wildcard replacing variable system but it lacked into control flow structures.

Then I’ve had contact with Smarty and PEAR’s DataObject (PHP language) at a company I’ve worked last year when we used a (very primitive and simple) kind of MVC with DO as model layer, Smarty as view layer and only one huge (around 130 KSLOC) controller that we called “The Godfather” as a private joke. After all, besides DO’s memory meanace, (almost) everything worked as it should but only after I’ve worked with CakePHP’s (Ruby’s) MVC implemetation that I realised how everything should behave.

MVC stands for “Model View Controller” and it’s a multi-layered design pattern. It’s one of the most famous (uhhh the flashes!) and organized design patterns I’ve worked so far because you can split the codes from your database calls and templating system.
Read the full article