[Zope3-dev] ObjectHub notes: removing objects

Chris Withers chrisw@nipltd.com
Thu, 17 Oct 2002 10:16:10 +0100


Gary Poster wrote:
> PRO: I can think of a use case for it.  On object removal, we might want
> to do more complex behavior than merely either removing the link or
> raising an exception.  We might want to allow the removal but make a
> "ghost" placeholder to which the object-hub-related information can
> still point, for instance.  

YAGNI

> CON: (1) delegating the *essential* behavior of what to do when an
> object is removed to a plugin seems a bit risky.  

Indeed.

> (2) it's not a direct
> parallel to what I proposed to do for object added events.

Symetry is good.

I think the ObjectHub should maintain it's own registry and not rely on 
something external to do it.

The ObjectHub receiving an IObjectRemoved should unregister the object and let 
any subscribers know that it's gone.

cheers,

Chris