[Zope] ZCatalog in a ZClass

Kevin Dangoor kid@kendermedia.com
Sun, 11 Jul 1999 20:46:12 -0400


    I'm starting work on my first ZClasses. I have news story code that
I am using at http://www.byproducts.com. I am changing it from a system
using DTML Methods in various Folders, TinyTables and such into
something that is designed with ZClasses and ZCatalog.

    I want to make sure I understand this correctly:

- I am creating an ArticleStorage Product & ZClass that is designed to
contain and manage Article(s) (another ZClass)

- If I were to put a ZCatalog inside the ArticleStorage ZClass, that
catalog would contain the information from *all* ArticleStorage
instances

- Or, if I have the add method of ArticleStorage create the ZCatalog,
then the catalog would index only that given instance's Articles.

Is that correct?

From a design standpoint, does it make more sense to have the catalog
acquired from somewhere outside the ArticleStorage? That way, if there
is information in the ArticleStorage and information in other places,
they can all be conveniently searched via one catalog.

The reason I was thinking of putting the catalog inside of the
ArticleStorage is because there are specific things that need to be
indexed within the articles for this to work (eg "Category")

Opinions?

Thanks,
Kevin