Professional Software Consulting
CakePHP: MVC Framework

CakePHP is an open-source PHP framework that, in my opinion, eliminates approximately 70% of the coding required to create a web application. It uses the model-view-controller (abbreviated MVC) design pattern to separate code into three distinct parts of the application.

  • Models. Models contain code that is related to the application's data, such as validation and retrieval rules. Think of this as the database layer.

  • Views. Views contain code that is related to what the user sees, such as formatted data, buttons, or dropdowns. Think of this layer as the client layer; it includes HTML, CSS, and javascript.

  • Controllers. The heart of the application, the controllers contain business logic that uses the models to generate information for the views. In this layer lies the intricacies that tend to make a web application unique.

This is how CakePHP defines the MVC pattern; purists might argue that the controller should not contain business logic, it should only be a handler between views and models. The problem I have with that is, where does the business logic then go? It must reside either in the views or in the models, because they're all that's left. Since the purpose of MVC is to enable an application's appearance to be changed easily, the business logic must reside in the model in the purists view.

In my opinion, the CakePHP approach works out better because dividing the application into three distinct layers provides more code re-use and a better learning curve than combining data code and business code, like in the two-layer model.

The framework includes an array of utilities that assist the developer with issues such as authentication, security, email, sessions, internationalization, caching, forms, number formatting, pagination, RSS feeds, and more. In addition, there is an area called the bakery, where developers have posted their additions to CakePHP's already impressive array of functionality.


     Contact Us     

Something wrong with this page or this site? Let the webmaster know by clicking HERE
This website designed, implemented, and maintained by Corey Dulecki
© 2009-2012, Corey's Consulting LLC