[Zope] Omnipresent objects?

Wankyu Choi wankyu@neoqst.com
Tue, 8 Apr 2003 02:24:48 +0900


Hi all,

There should be a really simple solution to the problem I'm facing, but =
want
to make sure if the solutions I'm considering are viable ones.

I'm designing a shopping cart product. A complete rewrite of its PHP
counterpart, which makes use of MySQL as backend.

Basically the PHP version uses the following MySQL tables to categorize
products and present them to users accordingly:

- a category description table: all categories go into this table

- a product description table: all descriptions of purchasable products =
go
into this table

- a category-product mapping table: the table tells us which product =
belongs
to which category. It **allows** a product to get associated with
**multiple** categories.

Well, guess it'll be easy to implement the first two tables as objects =
in
Zope.

The problem arises from the fact that we should be able to put a product
object into multiple category folderish objects without actually
**duplicating** it: if a product goes under the Categories A and B and =
when
we delete the product from its parent Category A, it should be also =
deleted
from the Category B. The same logic should also apply when we modify the
object. It's much like creating a reference to an object instead of =
actually
deep-copying it when we copy a product from one category to another.

I thought about putting all product objects into a single root category =
(
self-catalogging and BTreeFolderish ) and make subcategories =
transparent:

/Bookstore              - root category
/aBook                   - a product object
/Thriller                   - subcategory ( transparent folderish )
/Romance               - subcategory ( transparent folderish )
/Romance/Sheldon  - sub-subcategory (transparent folderish, will this =
nested
subcategories work? not sure. )=20

We can visit the aBook object taking advantage of acquisition:=20

- /Bookstore/aBook
- /Bookstore/Thriller/aBook
- /Bookstore/Romance/aBook
- /Bookstore/Romance/Sheldon/aBook

Will this work without any problems? What would be the easiest way to
implement this? ( Without relying on RDBMS like MySQL , of course :-)

Any hints or comments would be greatly appreciated.

Cheers,
Wankyu Choi

---------------------------------------------------------------
  Wankyu Choi
  CEO/President
  NeoQuest Communications, Inc.
  http://www.zoper.net
  http://www.neoboard.net
---------------------------------------------------------------  =20