[Zope-dev] Observer / Notification Interface Proposal

Tres Seaver tseaver@palladion.com
Thu, 25 May 2000 10:42:23 -0400


Michel Pelletier <michel@digicool.com> wrote:
> 
> I'll do both, this is absolutely a desperately needed feature in the
> ZCatalog.  Currently, Cataloged items must take responsibility for
> notifying a catalog of their changes instead of the ZCatalog observing
> them.
> 
> Amos and I talked about this over Pizza a couple weeks ago but we were
> thinking from a pretty Catalogcentric view; or at least I was.  I was
> considering an interface like the new Security API that could be
> imported in python and used to discover and notify catalogs of object
> changes.  But this now seems to me to be some kind of pattern where
> objects need to discover an appropriate or canonical resource, like a
> catalog.  This interface should be defined also, so that newly-born
> objects can notify a resources of their existence.  I've added this to
> the InterfacesWiki
> 
> http://www.zope.org/Members/michel/Projects/Interfaces/Discovery
> 
> Thoughts on how they relate?  Are they the same thing?

I think this pattern is orthagonal to the ObserverAndNotification
pattern, but is crucial to making things like 
TheClassFormerlyKnownAsCatalogAware and Ken's new WikiRelationship
object work.  CORBA solves this by mandating that the ORB provide a
lookup method::

   def resolve_initial_references( resource_type ):

where resource_type is a well-known string like 'NamingService', etc.

In our case, perhaps it needs to be::

   def findNearestResource( meta_type ):

which causes a walk up the containment hierarchy, searching for objects
of the given meta_type.

Tres.
-- 
=========================================================
Tres Seaver                          tseaver@digicool.com
Digital Creations   "Zope Dealers"   http://www.zope.org