[Zope3-dev] Sprintathon: searching?
Martijn Faassen
faassen@vet.uu.nl
Wed, 6 Nov 2002 13:10:22 +0100
Chris Withers wrote:
> kapil thangavelu wrote:
> >
> >umm. i think thats what steve is saying. the object itself knows nothing
> >of the interface, the adapter handles the object. so neither the catalog
> >nor the the object are specifying whats to be indexed.
>
> This fells overly compelx an uncessesary. I want to index something, I got
> to the indexer and configure which attributes I want indexed. Why would I
> want to care about adapters et al?
We were talking about indexing the 'full text content' of an object.
What this means depends on the type of object. It is however frequently
not the responsibility of the object itself to know about it; otherwise
all objects that could be indexed suddenly have to grow a method returning
their full text content. While this is a possible implementation strategy
in Zope 3, it's inflexible, so we'd like to avoid mandate it.
Therefore an adapter is proposed which implements an interface that has
a method that returns the full text content. You put the code determining
what full text content means for a certain type of object (or really which
interface you care about) in the adapter. This keeps both the indexer
and the original object more simple.
It's probably possible to come up with a set of standard adapters which
you can configure and reuse. And there could be a default behavior as well.
Anyway, this all follows the basic Zope 3 philosophy. The hope is this
allows us to write objects which only care about their core responsibilities
("I am contact information"), and put the framework responsibility (towards an
indexing system or an object publishing system or a security system or a
persistence system or HTML view framework and so on) outside those objects. T
This way we can avoid growing fat magic objects like we have in Zope 2 and
hopefully increase the flexibility of the system by a lot.
I hope this explains things.
Regards,
Martijn