Skip to main content

Posts

Showing posts from July, 2013

Why implement Fat Model and Skinny Controller in CakePHP

Fat Model and Skinny Controller  encourages developers to include as much business logic into the application models and the controllers should translate the requests, instantiating classes, getting data from the domain objects and passing it to the view. This development methodology is not new but rarely adopted among the developers. Developers should focus on creating model behaviors rather than creating controller components. It is a simple and powerful concept to implement is offers numerous convenient features to the developers. Controller is responsible for handling & executing the actions routed through the router, it should be lightweight and agile in nature. It is not about counting the lines in controller, rather putting codes in the right place. Why Fat Model and Skinny Controller: After developing for a while, when you look back at your code you’ll realize how hard it is to keep track of all these things. When you have a  Fat Controller , it can get pr