[Zope3-dev] ObjectHub Moved events (was re: ObjectHub Event names proposal)

Gary Poster gary@modernsongs.com
06 Aug 2002 11:30:08 -0400


On Tue, 2002-08-06 at 07:03, Steve Alexander wrote:
> Florent Guillaume wrote:

...

> > - an object is moved
> 
> IObjectMovedEvent, if it is renamed within the same folder.
> An IObjectMoved event should probably extend both IObjectAddedEvent and 
> IObjectRemovedEvent.

The added event and the removed event both use the same method for
retrieving the pertinent absolute path (getLocation).  In this case, we
are removing from one location and adding to another, so this won't work
practically.  See below for more general concerns.

...

> > My question really is about movement: will that generate an
> > Removed+Added event, or a Moved event, or both?
> 
> A moved event, which is both.

I am concerned with the general idea of making an *ObjectHub* movement
event be connected in any way with removal/addition, by subclassing or
by launching multiple events.  

As far as a given folder is concerned, yes, an object moved from its
collection should probably perceive this as a removal.  Arguably, in the
EventService, this might translate to a standard, non-ObjectHub removal
event, I suppose, or subclassing.  This merits further discussion
itself, I think, since it does not work that way now.

However, the use cases for the ObjectHub center around *the ObjectHub
giving each object a unique id* that the plug-ins and other parties care
about.  [Yes, practically we are keeping track of locations, not
objects, and it is worth remembering that one object can be in multiple
locations, and thus have multiple ObjectHub RUIDs on the basis of these
multiple locations, but I am in the realm of use cases here, as I
said.]  

For an index-like plug-in, for instance, in the most common cases, a
"moved" event will be ignored, because the average plug-in cares about
the RUID, not the location (that abstraction being the ObjectHub's
reason for being).  No changes will be necessary to the plug-in's own
records or responses.  On the other hand, it will care deeply about
removals and additions, and likely have to do some work to accomodate
them.  Associating a move with a removal and an addition, then, is both
impractical and semantically problematic.  Index plug-ins that *do* care
about moves can specifically pay attention to them.

ObjectHub events have a more global scope than is proposed here.  A
moved event on a local level might be perceived as a removal and
addition, but on the global scale that an ObjectHub operates in, a move
is just that: a move.

IMHO,

Gary