Several problems can arise when applications contain a mixture of data access code, business logic code, and presentation code. Such applications are difficult to maintain, because interdependencies between all of the components cause strong ripple effects whenever a change is made anywhere. High coupling makes classes difficult or impossible to reuse because they depend on so many other classes. Adding new data views often requires re-implementing or cutting and pasting business logic code, which then requires maintenance in multiple places. Data access code suffers from the same problem, being cut and pasted among business logic methods.
The Model-View-Controller design pattern solves these problems by decoupling data access, business logic, and data presentation and user interaction.
MVC divides an application into three concerns:
• Model – Encapsulates core application data and methods for accessing it.
• View – obtains data from the model and presents it to the user.
• Controller – receives and translates input to requests on the model or the view.
The separation into three concerns is inspired by a information processing model where the controller represents system input, the model represents processing and the view represents the output of the system.
Pros
- Better Maintainability: Orders of magnitude in ease of maintainability.
- Code Faster: Separation of business logic allows for ease of reuse which in turn leads to faster development and less time on tedious maintenance tasks.
- Redesign UI Easily: Ability to reskin entire application very easily.
- Ease of growth: Controllers and views can grow as the model grows; and older versions of the views and controllers can still be used as long as a common interface is maintained.
- Already in used in Enterprise sites such as Yahoo Bookmarks.
- Database Abstraction: Most frameworks can easily switch an entire application to use MySQL, Oracle, or SQL Server. Code is not database specific.
Cons
- Need to become familiar with specific framework
Leading Options
- CakePHP – http://cakephp.org/
- Symfony – http://www.symfony-project.com/
- CodeIgniter – http://codeigniter.com/
- Mojavi – http://www.mojavi.org/
Michael Sleman
Tech Lead

