[Zope] Organisational vs. Functional hierarchies

David Given dg at cowlark.com
Tue Apr 19 11:31:15 EDT 2005


I apologise if this is a newbie question, but I can't seem to find
anything in the documentation about this.

The way Zope seems to want to organise things is so that folders roughly
equate to classes. That is, if I have B inside A, then B inherits its
behaviour from A. All of B's siblings are the same sort of object.

However, this means that I have to seperate all my various types of
object by kind, regardless of whether they're related.

Let's say I have a site that talks about flowers. I have two main kinds
of object: images of flowers, which support methods for scaling etc, and
descriptions of flowers, which support methods for rendering in various
interesting ways. I have to arrange things like this:

/
  Text
    HistoryOfTheDaisy
    MoreInformationAboutDaisies
    HowToGeneticallyEngineerRoses
    MyFavouriteRoseStories
  Images
    WildDaisy
    DomesticatedDaisy
    MutatedDaisyFromBeyondTimeAndSpace
    FakePictureOfABlackRose

This works, but is a bit icky. I have my daisies mixed in with my roses.

It would be far more convenient for organisational purposes if I
arranged things like this:

/
  Daisy
    Text
      HistoryOfTheDaisy
      MoreInformationAboutDaisies
    Images
      WildDaisy
      DomesticatedDaisy
      MutatedDaisyFromBeyondTimeAndSpace
  Rose
    Text
      HowToGeneticallyEngineerRoses
      MyFavouriteRoseStories
    Images
      MutatedDaisyFromBeyondTimeAndSpace
      FakePictureOfABlackRose

But to make this work, I need to duplicate all the code in each 'Text'
and 'Images' folder...

Is it possible to tell Zope that methods for a particular kind of object
should be found at a particular location, regardless of the containment
hierarchy? That way I could have /lib/text and /lib/image that contain
the reference code to make my text and images work; the Text and Images
folders would then point at these. Or even better, I'd like to do
without the Text and Images folders completely and just mix .pt and .jpg
files in the Daisy and Rose folders.

But I can't seem to find out whether I can do this.

Is this in fact possible, or do I need to start tinkering with custom
products?

-- 
+- David Given --McQ-+ "Every planet is weird. I spent six weeks on a
|  dg at cowlark.com    | moon where the principal form of recreation was
| (dg at tao-group.com) | juggling geese. Baby geese. Goslings. They were
+- www.cowlark.com --+ juggled." --- Firefly, _Our Mrs. Reynolds_



More information about the Zope mailing list