[Dev] Problem with collection notifications

John Anderson john at osafoundation.org
Mon Sep 26 10:50:39 PDT 2005



Alec Flett wrote:

> John Anderson wrote:
>
>> Yes in some cases we don't want any notifications. Consider this case:
>> wxWidgets handles the click, updates the selection on the screen and
>> tells us about the change. As a result we store the change in the
>> selection.
>
>
> I think this is a broken paradigm in CPIA - If CPIA is really a MVC 
> paradigm, then the proper thing to do would be to update the model (by 
> setting the selection attribute) and letting the view reflect this 
> change (by actually telling the widget to select something)

Actually this isn't a CPIA issue, it's a platform issue. Consider the 
case when a window changes size. The platform notifies us of the change 
and we have to update the model, but we don't need to also change the 
platform widget, its already up to date. The main thing to keep straight 
is that event driven platform frameworks keep the widgets up to date and 
all we need to do is reflect the change in the model. The completely 
different situation occurs when the data changes and for some reason the 
platform can't notice it. In that case we need to update the model and 
synchronize the widget to the new value.

>
> The problem is that we're trying to do BOTH: update the view and the 
> model manually, and then wishing the controller wasn't getting 
> involved. The reason for this is that we don't have complete control 
> of our widgets: when a user clicks the mouse, the widget wants to 
> update itself whether or not the model has actually changed.
>
> This is the one thing that always seems to be vaguely defined in the 
> MVC implementations I've worked with, including CPIA: proper 
> downstream (view -> model - maybe that's upstream? anyway..) 
> communication.
>
> My suggestion would be for the view (i.e. the widgets) to maintain 
> some sort of state about the fact that its changing an attribute 
> (selection) and then ignore notifications on selection. I don't think 
> that collection notifications should have to shoulder this burden 
> because its really proprietary to CPIA's design.

Yes, I\d like to ignore the notification. The problem is that I can't, 
because some of the notificaitons are asynchronous.

>
> Alec
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osafoundation.org/pipermail/chandler-dev/attachments/20050926/a948aff6/attachment.html


More information about the Dev mailing list