Need Zen advice, how to organize invoice items which I'm considering making folderish
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.
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?
Probably not, but I wouldn't want to browse a SQL database of 50,000+ entries either. The structure sounds fine, the problem is the presentation method. Take the records and use ZCatalog to do the presentation.
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."
Ugh, this might be a killer because that sort of thing can be hard to do in ZCatalog, check that you can do all the queries you want before you go down that path. -- Andy McKay
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."
This paragraph of yours describes classic SQL situation. Don't try it with ZODB. I make decisions about whether to use ZODB or SQL like this: STEP 1: Would the task benefit from ZODB: if no, use SQL. if yes, go to step 2 STEP 2: Would ANY of ZODB shortcommings affect adversely the task? if yes, use SQL. If no, use ZODB. ZODB is generally fine but you should take some of information provided by zope.com with a pinch of salt. ZODB is simply not as mature as most SQL solutions, include my favourite PostgreSQL. -- Milos Prudek
participants (3)
-
Andy McKay -
Jeff Kowalczyk -
Milos Prudek