[Zope] Need Zen advice, how to organize invoice items which I'm considering making folderish

Jeff Kowalczyk jtk@adelphia.net
Tue, 26 Mar 2002 19:11:22 -0500


I have a particular business process which I'd like to model in Zope
(coming from a relational database), and I need some advice from those
who have already had the Zen moment.

This process is heavily invoice-centric, and almost every object
(currently, table in my relational model) carries a reference to the
InvoiceID. The other 'tables' are mostly 'things that happen to
invoices', such as customer inquiries, confirmations, damage reports,
etc. Some things can happen more than once.

Therefore, I'm thinking of making the Invoice a folderish product class
with properties and methods germane to its workflow, such as deliver(),
or reportdamage(), etc. The results of these methods would be objects
that get created with each invoice folder.

Now comes the moment where I get confused by the choices: This process
will generate 50,000+ invoices per year. Nobody wants a to browse a
folder with 50,000 entries. Can I reasonably use transparent folders to
group all those invoices by day, week, month, and so on into a tree
heirarchy? No doubt it could be done, but should I?

I gather that transparent folders will reverse acquisition, such that
/Invoices/2002/March/24/Inv3022253356/Hello() will be equivalent to
/Invoices/Inv3022253356/Hello() . Is that correct?

Would the invoices still be 'as one collection' (thanks to the
transparency of their grouping folders) if I wanted to write python
scripts joining Zcatalog results that took the place of my current sql
queries? Sometimes you're thinking of the invoices as grouped by dates,
other times you're looking for the aggregate of other properties, such
as CustomerID. I need to be able to create things like "show all year
2001 invoices for customers in the 90210 zip code" as well as, "Show the
average invoice amount for the the top 10 customers."

I've got a ton of other questions about it, but for the moment, if
anyone can tell me whether this is a the dead-opposite way you should be
using Zope, I'd be very grateful.