[Zope3-dev] Re: ObjectHub notes: removing objects
Florent Guillaume
fg@nuxeo.com
30 Oct 2002 18:02:12 +0100
On Wed, 2002-10-23 at 21:20, Gary Poster wrote:
> On Wed, 2002-10-23 at 14:49, Florent Guillaume wrote:
> > There's another set of events that is interesting: for utilities that
> > track certain objects through their HubId, they may want for simplicity
> > to be relayed plain IObjectEvents through the ObjectHub so that they
> > receive the HubId info with the event. So here the role of the Hub would
> > be to forward all standard IObjectEvents (that concern an object that is
> > in the ObjectHub) as IObjectHubEvents to interested listeners. Here I
> > can see the use of IObjectModifiedHubEvent, IObjectMovedHubEvent, and so
> > on. A general mechanism to be able to forward any kind of event but with
> > additional info (HubId) would be nice.
>
> Hm. Not sure I like the general mechanism tacking on the hub id
> information, but yes, *all* events the objecthub receives are passed on
> to subscribers, only filtered by the *subscribers'* wishes.
Do you mean that the ObjectHub may relay all events as-is? What would be
the point of subscribing to those events through the ObjectHub instead
of directly from the EventService?
> If the
> object hub also recognizes the event as being pertinent to an object
> registered in the object hub then it, in addition, creates parallel hub
> event objects and sends those to interested subscribers. It is assumed
> that most subscribers will only be interested in one set of events or
> another; and if they *do* want them all, they can set their filters
> appropriately.
Ok.
> > The way I interpret the current discussion thread is, are
> > IObjectAddedHubEvent and IObjectRemovedHubEvent useful or are they
> > redundant with IObjectRegisteredHubEvent and
> > IObjectUnregisteredHubEvent?
> >
> > I'd say they are not redundant. Yes, IObjectRemovedHubEvent implies
> > IObjectUnregisteredHubEvent (the object no longer exists) and
> > IObjectAddedHubEvent implies IObjectRegisteredHubEvent (we're hearing
> > about a new object from the ObjectHub so it must have been registered).
> > But the implication does not go the other way, so the events are not
> > equivalent.
>
> FWIW, the current decision in code, in both the old object hub and the
> local object hub, is to eliminate the IObjectAddedHubEvent but keep the
> other three. The logic why has been discussed, and we all will agree or
> disagree. I think what we have is a good, practical, working
> compromise. It won't be set in stone till the Pope says so. :-)
That makes the framework look a bit ad-hoc and not very orthogonal to
me. I don't see what's gained by not being general here.
Florent
--
Florent Guillaume, Nuxeo (Paris, France)
+33 1 40 33 79 87 http://nuxeo.com mailto:fg@nuxeo.com