Results 1 to 25 of 118
Thread: The MVC's model
Jun 27, 2010, 20:08 #31
- Join Date
- Aug 2005
- 0 Post(s)
- 0 Thread(s)
I'm just playing devils advocate here, but...
the view only ever gets data from the model. There is a reason for this: the model is the only place which holds data.
I think what Tony is adovocating, and I have to agree, is that in web-MVC ( http://martinfowler.com/eaaDev/PassiveScreen.html) the dependencies change quite substantially because of the request-response cycle, as opposed to real-time, event based based environements.
In passive view, the controller queries the the model and feeds the views, as opposed to the view having a dependency on any model. This creates a one-way dependency from the controller to the model and controller to the view, in theory making each component more reusable.
Of course, as you noted with the pager, this is not always the best approach, but it really depends on context, which is where I think Tony and you differ most.
AlexThe only constant in software is change itself