[Zope3-dev] ObjectHub Event names proposal

Steve Alexander steve@cat-box.net
Tue, 06 Aug 2002 00:29:28 +0100


Gary Poster wrote:
>>- What is the semantic difference between IObjectRegisteredHubEvent and 
>>IObjectAddedHubEvent ? IOW why do we need both ?
> 
> 
> Added: a new object is created
> Registered: an object is registered in the hub
> 
> The distinction might be important if an already-existing object is
> registered in the ObjectHub.  That is, 
> * if an object that the hub cares about is *created*, both an "added"
> and a "registered" event is disseminated.  
> * If the hub is merely newly-informed of an already-existing object,
> only a "registered"  event is sent.
> 
> Perhaps it would be worth pondering making "Added" a subclass of
> "Registered"?  So only one event would need to be propagated on an
> addition, an "Added" event, but this would in fact be a subclass of
> "Registered" so any interested parties to registration would also get
> their message.  
> 
> We would need to go through our use cases with these, I suppose.  Can we
> conceive of a usecase for a plugin that cares about object added events
> but not object registered events?  

This is a good point. I think it is ok to keep the events separate for 
now. Later, we can combine them as you suggest, if the use-cases show 
that this is the best way forward.

--
Steve Alexander