Re: MVC Design Variations?
Re: MVC Design Variations?
- Subject: Re: MVC Design Variations?
- From: "Ashley Aitken" <email@hidden>
- Date: Thu, 17 Jul 2003 11:16:10 +0800
Yes, Creed you are right.
If you have (in the Lite MVC) multiple views of the same model, the way
it usually works (as I have seen explained) is that the Views register
themselves with the models to be notified when any changes to the model
occurs.
I guess this a general mechanism so the model doesn't need to know much
(if anything) about the views (just to have a notification center or
similar to "signal" the views when the model changes).
It is then up to the views to query the model directly (so they need to
know about it) to get the data they require to update their particular
view (eg different pages in a text document may be being displayed by
different views).
The reason this is necessary is because it would be very inefficient for
the controller to get the entire model state (ie the entire text
document) and set it in all of the views every time the document changed
(separately from the views).
I guess this is why I called it MVC Lite (since it is not Pure MVC and
is there to be more efficient).
Cheers,
Ashley.
>
>> Creed Erickson <email@hidden> 07/17/03 06:00 AM >>>
On Wednesday, July 16, 2003, at 03:30 AM, Ashley Aitken wrote:
>
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.
>
One of the problems I see with this is that views are then forced to
know about each other and/or the state of the model. Consider two
separate views on the model, e.g. a split editing window. If the upper
view changes, only a mediating object -- a controller -- will be able
to determine how many and which views need updated.
---
Creed Erickson <email@hidden>
"Not a shred of evidence exists in favor of the idea that life is
serious."
- Brendan Gill
_______________________________________________
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.