[Zope] Catalog aware

Martijn Pieters mj at zopatista.com
Thu Jul 20 06:02:32 EDT 2006

Please don't email me personally; let's keep this discussion on the list.

Garito wrote:
> Yes, the indexes depends on the entity (I don't know what indexes I use
> until I define the entity but I need to catalog every characteristic of
> the entity)
> For example if I have a entity with a container where to put my cousins
> information I will catalog a keyword index called (is an example,
> remeber) HowMuch that counts the number of the objects stored in the
> container
> Or if I talk about skills I will catalogue the marks or the way to print
> the certificate of excelence (again an example)

But then you can create specific subclasses that are catalog aware. What
standard objects would you use to implement this? You have a specific,
non-generic use-case that has already been catered for by the framework.

>> Making all Zope objects catalog aware by default makes no sense
>> though. You have yet to come with a compelling generic use-case, let
>> alone with one that convinces me. Why catalog database connectors for
>> example? What kind of search are you performing?
> Please, don't think in a particular case, think a way to do that if you
> need

No, we need a use-case. Otherwise you have what we call a YAGNI, a "You
aint gonna need it" feature that noone will maintain because noone uses it.

A vague notion that you'd like to see this for your application is not a

>> Have you thought about the potential problems of making all objects
>> catalog-aware by default, like potential conflicts and side-effects?
> What kind of side-effects or conflicts (put an example to understand,
> please)

Catalog indexes retrieve their infomation from the object, through a
named attribute. If that attribute is callable, the index calls it, so
it executes the code. That may have side effects not originally forseen
because the original code never anticipated being indexed. This can
happen when the attribute name can mean different things in different

Zope is a complex beast, and the idea of making everything catalog aware
is not going to play well.

>> I say a big -infinity from me on the whole idea.
> I can't understand the last sentence (my english is a kid english, sorry
> again!)

It means I say no to the idea. A big no.

Martijn Pieters

More information about the Zope mailing list