[Zope] Object references

Robert Leftwich robert@leftfieldcorp.com
Wed, 12 May 1999 20:34:07 +1000


What is the Zope way of holding references to objects in another object.
Using the following ordering entry system as an example :

Catalog contains zero or more CatalogItems
CatalogItems are structured as CatalogItemNo, Description, UnitPrice, ...

Order contains OrderNo, OrderDate, zero or more OrderItems, ...
OrderItems are structured as CatalogItem, Quantity, ...

What should the link between OrderItems and CatalogItems be ?

In relational databases you would store the CatalogItemNo and in object 
databases a CatalogItem object reference.
Given that I am using the Zope object database, how do I store a reference 
to a Zope CatalogItem object ?

If it is possible to store the object reference, this gives rise to another 
question, how do you maintain the referential integrity of such a system, 
e.g. what do you do if someone deletes a CatalogItem that is used by some 
orders ?

Thanks in advance
Robert Leftwich