Fat Models, skinny Controllers

I think that’s quite a lovely design pattern!

The controller isn’t there to do everything. It is there to determine what needs to be done, and have other parts of code do it.

You keep the overview in the Controller, so that the Controller only needs to do small alterations to posted data or direct the data to the Model, which can handle it accordingly.

The Controller basically is used as a manager..

Thanks for the data View, handle it Model!

Small example of the functions M & C should do:

Controller

  • Handle GET & POST data
  • Logical alterations of the data provided by either the Model or View
  • Passing data from View to Model
  • Passing data from Model to View

Model

  • Save data to the database
  • Retrieve data from the database
  • Handle caching
  • Handle custom functions to manipulate database

Leave a Reply

Your email address will not be published. Required fields are marked *