[Zope3-dev] Index integration

Dieter Maurer dieter at handshake.de
Sun Feb 13 13:00:34 EST 2005


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.


-- 
Dieter


More information about the Zope3-dev mailing list