On 28 Nov 2005, at 19:30, Dominik Huber wrote:
Florent,
But at least the event notifications within the setitem function is kind of redundant. An add-, move- and remove- event is a part of the container framework. Therefore we can assume that the underlying container referenced by the event.object.__parent__ has changed too.

file: zope.app.container.contained.py:

def setitem(container, setitemf, name, object):
   ...
   if event:
       notify(event)
       notifyContainerModified(container)

If you don't have this container notification, then when you want to know when a given container object is modified you have to listen to all add, remove and move events, and then introspect their oldParent and newParent. Doh.

The object event framework promises you that if there is something happening to an object, you get notified of it directly. That's what I'm doing here, I'm notifying that the container object was modified, because it was.

If you have a problem with that event, then you should have a problem with the whole concept of event dispatching to sublocations, which are also "redundant" but which we want to make explicit nevertheless, for the benefit of subscribers.

Florent

--
Florent Guillaume, Nuxeo (Paris, France)   Director of R&D
+33 1 40 33 71 59   http://nuxeo.com   [EMAIL PROTECTED]


_______________________________________________
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com

Reply via email to