nemetral.net | Insightful posts on design and code
In part 1, we decoupled a vanilla PHP script and separated the business logic from the presentation. In part 2, we added a third element in the mix called the model and dedicated to the data access layer. It is now time to spice up the coding by introducing the role of Object-Oriented Programming in a MVC architecture and release the very basis (for educational purpose only) of a MVC framework.
In part 1, we saw how to decouple a traditional vanilla PHP script so as to separate business logic from presentation. This was the biggest step to make: from now on, we are just going to finetune this separation by adding a 3rd guy in the equation: the model. Ladies and gentlemen, this is part 2 of A gentle introduction to MVC.
MVC is certainly the widest spread architectural pattern in today's webdevelopment landscape. Brought back to fashion by Ruby on Rails from 2004 on, it has been translated and implemented into many languages and more than 100 web frameworks. This illustrated three-part is aimed at helping you cross the gap between a traditionnal vanilla PHP script and a full MVC implementation.
Nemetral is a freelance webdeveloper with 7+ years experience in the industry. On nemetral.net you will find insightful posts on design and code, tackling various topics related to webdevelopment from a highly educational perspective.
The very best of nemetral.net, as selected by readers.
Integrating design and code.
Exclusive articles written by nemetral, published elsewhere on the web.