Welcome Guest, Not a member yet? Register   Sign In
Putting the View back into MVC.
#25

[eluser]wiredesignz[/eluser]
The strange thing to me is that most CI example code suggests collecting your model resultset in an array and passing this to your view. Not only does this place more demand on memory, but breaks the basic MVC principle of seperation of concerns.

It seems more fuctional to fully prepare the data for display while its still in the Model and then pass only a reference to the Model into the View.

The View remains independent of the Model, the reference can be changed at any time by pointing to a different Model as needed, and the View processing is simplified.

EDIT:
On a second reading I can say quite categorically, Pygon and xwero have the MVC design pattern correct, Controllers are not supposed to gather data or manage business logic.

Each component must be reusable, the Model goes with its data source and doesnt care about the Controller or the View, the View needs a data source, but it doesnt depend on one exact Model, any Model providing the correct data could be used. The Controller should not depend on either the View or the Model.


Messages In This Thread
Putting the View back into MVC. - by El Forum - 03-12-2008, 08:21 AM
Putting the View back into MVC. - by El Forum - 03-12-2008, 08:38 AM
Putting the View back into MVC. - by El Forum - 03-12-2008, 08:43 AM
Putting the View back into MVC. - by El Forum - 03-12-2008, 08:55 AM
Putting the View back into MVC. - by El Forum - 03-12-2008, 08:58 AM
Putting the View back into MVC. - by El Forum - 03-12-2008, 08:58 AM
Putting the View back into MVC. - by El Forum - 03-12-2008, 09:11 AM
Putting the View back into MVC. - by El Forum - 03-12-2008, 09:15 AM
Putting the View back into MVC. - by El Forum - 03-12-2008, 09:16 AM
Putting the View back into MVC. - by El Forum - 03-12-2008, 09:27 AM
Putting the View back into MVC. - by El Forum - 03-12-2008, 09:31 AM
Putting the View back into MVC. - by El Forum - 03-12-2008, 09:35 AM
Putting the View back into MVC. - by El Forum - 03-12-2008, 09:36 AM
Putting the View back into MVC. - by El Forum - 03-12-2008, 09:40 AM
Putting the View back into MVC. - by El Forum - 03-12-2008, 09:45 AM
Putting the View back into MVC. - by El Forum - 03-12-2008, 09:49 AM
Putting the View back into MVC. - by El Forum - 03-12-2008, 09:53 AM
Putting the View back into MVC. - by El Forum - 03-12-2008, 09:54 AM
Putting the View back into MVC. - by El Forum - 03-12-2008, 10:03 AM
Putting the View back into MVC. - by El Forum - 03-12-2008, 10:08 AM
Putting the View back into MVC. - by El Forum - 03-12-2008, 10:16 AM
Putting the View back into MVC. - by El Forum - 03-12-2008, 10:22 AM
Putting the View back into MVC. - by El Forum - 03-12-2008, 10:30 AM
Putting the View back into MVC. - by El Forum - 03-12-2008, 12:30 PM
Putting the View back into MVC. - by El Forum - 03-12-2008, 05:44 PM
Putting the View back into MVC. - by El Forum - 03-13-2008, 01:06 AM
Putting the View back into MVC. - by El Forum - 03-13-2008, 01:32 AM
Putting the View back into MVC. - by El Forum - 03-13-2008, 01:59 AM
Putting the View back into MVC. - by El Forum - 03-13-2008, 04:03 AM
Putting the View back into MVC. - by El Forum - 03-13-2008, 04:53 AM
Putting the View back into MVC. - by El Forum - 03-13-2008, 05:20 AM
Putting the View back into MVC. - by El Forum - 03-13-2008, 06:25 AM
Putting the View back into MVC. - by El Forum - 03-13-2008, 06:33 AM
Putting the View back into MVC. - by El Forum - 03-13-2008, 06:55 AM
Putting the View back into MVC. - by El Forum - 03-13-2008, 07:17 AM
Putting the View back into MVC. - by El Forum - 03-13-2008, 07:26 AM
Putting the View back into MVC. - by El Forum - 03-13-2008, 07:37 AM
Putting the View back into MVC. - by El Forum - 03-13-2008, 08:18 AM
Putting the View back into MVC. - by El Forum - 03-13-2008, 08:41 AM
Putting the View back into MVC. - by El Forum - 03-13-2008, 09:08 AM
Putting the View back into MVC. - by El Forum - 03-13-2008, 09:12 AM
Putting the View back into MVC. - by El Forum - 03-13-2008, 09:14 AM
Putting the View back into MVC. - by El Forum - 03-13-2008, 10:00 AM
Putting the View back into MVC. - by El Forum - 03-13-2008, 10:01 AM
Putting the View back into MVC. - by El Forum - 03-13-2008, 10:46 AM
Putting the View back into MVC. - by El Forum - 03-13-2008, 10:49 AM
Putting the View back into MVC. - by El Forum - 03-13-2008, 10:50 AM
Putting the View back into MVC. - by El Forum - 03-13-2008, 10:54 AM
Putting the View back into MVC. - by El Forum - 03-13-2008, 11:46 AM
Putting the View back into MVC. - by El Forum - 03-13-2008, 12:13 PM
Putting the View back into MVC. - by El Forum - 03-13-2008, 12:21 PM
Putting the View back into MVC. - by El Forum - 03-13-2008, 03:02 PM
Putting the View back into MVC. - by El Forum - 03-14-2008, 07:56 AM
Putting the View back into MVC. - by El Forum - 03-14-2008, 08:11 AM
Putting the View back into MVC. - by El Forum - 03-14-2008, 09:35 AM
Putting the View back into MVC. - by El Forum - 03-14-2008, 09:46 AM
Putting the View back into MVC. - by El Forum - 03-14-2008, 09:51 AM
Putting the View back into MVC. - by El Forum - 12-19-2008, 03:14 PM



Theme © iAndrew 2016 - Forum software by © MyBB