[Zope3-dev] Index integration

Jim Fulton jim at zope.com
Mon Feb 14 10:20:02 EST 2005


Dieter Maurer wrote:
> Reindexing objects after changes can be quite expensive.
> Therefore, we probably want to reduce the number of indexes
> that need to be updated after a change.
> 
> It seems natural for the Zope3 philisophy to associate
> an interface with each index. The index indexes objects
> that implement this interface.
> 
> Then, an object needs reindexing by an index "I", when
> the values as provided by the interface associated with "I"
> have changed. We could define interface related "Changed" events
> that signal a change relevant for their respective interface.
> Apparently, this is the route Zope3 currently goes.
> Thus, I have seen "ContentChanged", "MetadataChanged",
> "AnnotationsChanged" events.
> 
> However, this approach leads to an event proliferation along
> the lines of the interface proliferation. At least, it makes
> index configuration more complex.
> 
> 
> I propose as alternative a new concept "DependentObject", represented
> by the interface "IDependentObject". A "dependent object"
> is part of a primary object and is indexed under this primary
> object. Thus, a "dependent object" can provide values for
> the indexing of its primary object but is not itself indexed.
> 
> "IDependentObject" has a single method (or attribute, if you prefer):
> 'getPrimaryObject' returning the primary.
> The catalog determines the uid for an indexing request for "o"
> from its primary object, if "o" is a dependent object.
> However, the set of indexes that need an update is determined
> from "o"'s interfaces and "o" provides the values for the reindexing.
> 
> This way, there is no need for interface specific "Changed" events.

I'm not sure I follow this.  Are you saying that you'd generate
an ObjectModified event for the dependent object and then decide the
indexes to update according to the type of the dependent object?

Jim

-- 
Jim Fulton           mailto:jim at zope.com       Python Powered!
CTO                  (540) 361-1714            http://www.python.org
Zope Corporation     http://www.zope.com       http://www.zope.org


More information about the Zope3-dev mailing list