[Zope3-dev] ObjectHub notes: removing objects

Steve Alexander steve@cat-box.net
Sun, 20 Oct 2002 14:56:03 +0200


> I'm no longer sure where I stand on this.  I'm leaning towards Chris'
> position.
> 
> While I agree with you, Steve, that the meaning is in fact different
> between the two objects, I cannot think of an excellent use case for an
> Object Hub client that actually *cares* about this distinction.  If I am
> a relationship service, if something tries to break the registration of
> an object for which I have a relationship, I am equally concerned about
> the event (I must delete the relationship, or I must raise an error
> stopping the registration removal) as if the object were being removed,
> and my actions are the same.  If I am a metadata cache service, again,
> my actions are identical in both cases (remove the metadata).  If I am
> an indexing service, my actions are identical (remove the pertinent
> hubid from my indexes).
> 
> Is there a practical difference to the *consumers* of these events,
> despite the fact that we see one from the outside?  Don't an object
> removal and a workflow-related unregister call both require the same
> exact processing from all ObjectHub clients?

They are different when you want to delete a Container, an have the 
objecthub receive a single ObjectDeleted event, have the objecthub send 
on a single HubIdObjectDeleted event, and then have a subscriber to that 
event determine transitively the registered objects that are contents of 
the deleted container, and inform the objecthub and its subscribers of 
the deletion of the objects.

--
Steve Alexander