Welcome Guest, Not a member yet? Register   Sign In
where does the controller begin and the model end?
#8

[eluser]danoph[/eluser]
I believe your model should be written once and updated only as needed. It should NOT manipulate data because:
1. If you use your model to just retrieve raw data, you can pass it on to the controller and have the controller manipulate the data, then passing it on to the view. Your model can be written once and have one purpose being the core of your project.
2. If you are testing new stuff on a LIVE website, you can create new methods in controllers to manipulate the data from the model without screwing up the website that people are viewing at that moment.
3. Having a model that you don't have to touch often helps separate your project and isolate problems, whether they are in the model, controller or views.

I wrote an article on this a while ago called How CodeIgniter Keeps You Organized


Messages In This Thread
where does the controller begin and the model end? - by El Forum - 09-28-2007, 10:07 AM
where does the controller begin and the model end? - by El Forum - 09-28-2007, 11:25 AM
where does the controller begin and the model end? - by El Forum - 09-28-2007, 12:11 PM
where does the controller begin and the model end? - by El Forum - 09-28-2007, 01:55 PM
where does the controller begin and the model end? - by El Forum - 09-28-2007, 04:05 PM
where does the controller begin and the model end? - by El Forum - 09-28-2007, 04:52 PM
where does the controller begin and the model end? - by El Forum - 10-08-2007, 08:28 AM
where does the controller begin and the model end? - by El Forum - 10-08-2007, 11:15 AM
where does the controller begin and the model end? - by El Forum - 10-08-2007, 11:44 AM



Theme © iAndrew 2016 - Forum software by © MyBB