[Zope3-dev] ObjectHub notes: removing objects
Steve Alexander
steve@cat-box.net
Thu, 17 Oct 2002 12:39:12 +0000
>> (2) it's not a direct
>> parallel to what I proposed to do for object added events.
>
> Symetry is good.
Symmetry is good for symmetrical things. I think this case is somewhat
lopsided, on account of the object being already registered when it is
removed. We're not interested in all object removed events, only in
those where the object is already registered with the Hub.
This is different than the case when an object is added, where we need
to decide whether to register it or not.
> I think the ObjectHub should maintain it's own registry and not rely on
> something external to do it.
The Hub needs to maintain its own registry of HubId<-->location.
> The ObjectHub receiving an IObjectRemoved should unregister the object
> and let any subscribers know that it's gone.
Yes. However, subscribers may be interested in the fact that the object
was not simply unregistered, but was deleted and therefore unregistered.
Again, this is different from the case when an object is added, as the
object is not registered at the time it is added, and so the adding of
the object leading to its registration is not a concern of the Hub or
its regular HubEvent subscribers.
Of course, adding an object to a container that is registered could
cause some sort of ObjectChanged event to be sent on behalf of the
container.
--
Steve Alexander