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

[eluser]Crafter[/eluser]
It's best to think of your layers of the MVC framework as seperate, in other words, each is self contained and there is no beginning and end. However, the containment is limited to its function in the framework.

Theoretically, your model should be seperate from the controller. You might for example, want to move the storage off to some remore location where data is stored on some unusla media. This shouldn't matter to your controller.

In practice, however, we often find that the controller needs to know the structure of the model. For example, we often find this in controllers:
Code:
$data['field1'] = value1;
$data['field2'] = value2;

The only way we can make the controller truly independant from your data nodel is to introduce some kind of despatcher that feeds business rules and models to the requestor. Then it only makes sense to have a single generic controller and "model handler" within your application.


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