[Zope] (no subject)

Dieter Maurer dieter@handshake.de
Mon, 13 Aug 2001 20:41:57 +0200 (CEST)


Pablo Ziliani writes:
Your audience here would be happy if your posts had a non-empty Subject...

 > I have a brand new problem:
 > I=B4ve created a new Zclass "NewsClass" that sublasses
 >=20
 > - ZObject
 > - CatalogAwareBase (?)
 > - ZFolder (?)
 > - ZCatalogBase (?)
 > - ZObjectManager
After you derive from "ZFolder", there is no need to derive
from "ZObjectManager".

With high probability, "ZCatalogBase" already makes your
ZClass folder-like. Therefore, no need to derive from "ZFolder".

After you made your "NewsClass" a "Catalog", it is doubtful,
that you make it "CatalogAware". Which catalog should be
informed, when a "NewsClass" instance is created/deleted
(that's the feature provided by "CatalogAware")?

How can *you* decide which classes should be integrated?

  Each class provides some features.
  If you need the features, the class become a base candidate.
  If the same feature is provided by several classes,
  you will usually include only one of them.

 > where (?) means: I don=B4t know why I did this.
You should!

 > Inside  NewsClass I defined an other ZClass "SectionClass"
 > which subclasses
 >=20
 > - ZObject
 > - ZObjectManager
 > - ZFolder (?)
You will use either "ZObjectManager" or "ZFolder", not both.
"ZFolder" is an "ZObjectManager" which is in addition
a "PropertyManager" and provides some additional tabs.

 > 1) The problem is that when I=B4m on a NewsClass instance, I can=B4t g=
et the=20
 > select menu shows me the option "Add Sections". It does shows it if I =
move=20
 > the factory to the same level of NewsClass but, of course, this=20
 > makes "Sections" (almost) available from anywhere.
There may be a HowTo at Zope.org.
There definitely are threads in the (searchable) mailing list archives.
Search for "nested ZClasses".

 > 2) Having a newspaper as the obvious target, am I choosing the right b=
ase=20
 > classes for it?
I do not know, but:

  * look at the available base classes and check what features
    they provide

    To do that, you will look at the corresponding Zope classes.
    E.g. "ZCatalogBase" provides the features of a "ZCatalog"
    for a ZClass,
    "ZObjectManager" provides the features of an "ObjectManager"
    for a ZClass, etc.

  * look at your task and decide what features you need

  * derive a list of candidate base classes

  * eliminate redundant classes from the list.


Dieter