MVC Design Variations?
MVC Design Variations?
- Subject: MVC Design Variations?
- From: "Ashley Aitken" <email@hidden>
- Date: Wed, 16 Jul 2003 18:30:41 +0800
Howdy All,
I trust this isn't too far off topic - it relates to general MVC
design, and particularly how Cocoa works in a particular context.
When discussing the MVC design pattern most people talk about how
control objects separate the model objects from the view objects
"completely."
For example, a clicked button messages the controller, the controller
then gets inputs from the GUI and sends messages to the model objects to
effect the required operation, getting any results from the model
objects and sending them to the GUI. In this case, the view and model
objects do not interact directly.
This approach seems fine for interfaces where the data displayed is
simple and can easily be passed back and forth by the controller. I'll
call it Pure MVC.
However, when the model data is large (or more particularly the
display of that model data is selective, eg a page of a word processing
document) it is not sensible for the controller to pass all the data
back and forth between the view and model. In this case, it is more
appropriate for the view to query the model for what it needs to update
its display etc.
In this case, the views are often registered as observers of the model
and notified of changes (so they can update). I'll call this MVC Lite.
My first question is: is this a reasonable understanding of the
situation (given the limited room for explanation of all the
possibilities here)?
My second question is: how does Cocoa handle this *now*? I understand
that some GUI components (tables) have an associated model rather than
their own data.
However, does it directly interact with the model or go through a
controller?
Thanks for any insight.
Cheers,
Ashley.
PS Please reply to my email as well as the list, as I only receive the
list in digest form.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.