[Zope] Are products the right approach?

Carsten Gehling carsten at sarum.dk
Thu Sep 18 03:44:12 EDT 2003


Since I'm new at Zope, I would value your opinions very much about my
choices in this first project.

My first Zope project is creating an intranet for a local TV company.

They wish to store information about their equipment, spare parts, etc., and
maintain logs about the equipment's current state (working, out of order,
being maintained, etc.).

(note: This is only a small part of their intranet, extracted for discussion
purposes).

Right now, I've made the following folder structure:

----------------------------------
/root
...
    intranet
        Technical
            Equipment
            SpareParts
----------------------------------
I have created two product classes called Equipment and SpareParts. As it
might be obvious, objects of class Equipment should only be created in the
folder Equipment, and likewise with SpareParts.

Objects of both classes store information about the specific piece of
equipment or spare part. I've also made a superclass called "Loggable",
which they inherit to be able to create logs about the use and maintainance
of said object.

The logs, however, are stored in a relational database. I've done it this
way, because I need to create reports later on for the equipment and spare
parts based on the logs.

So the "class hierarchy" is pretty much like:

SimpleItem   Loggable
   |------+-----|
          |
       Equipment

and the same for SparePart

At the moment, I'm not sure this is the right approach. My judgement may be
clouded since I come from the relational-DB world.

1) Should Equipment and SparePart be classes or perhaps instead tables in my
RDBMS? (ATM they are classes to facilitate the history/undo functionality in
Zope)

2) Should I make it all as classes (including the Log)?

3) How do you make relations between objects in Zope? (For use in eg.
reporting)

4) I'm going to make a scheduled "event handler" that sends out mail
messages based on the latest log entries. This needs to be able to find an
object in ZODB based on the log entry - how do I make this connection?

I deliberately did not include any source code, since this is more a
discussion of techniques and principles. If any of you wish to see some of
my code before answering, please say so.

I hope you can help me. TIA

- Carsten




More information about the Zope mailing list