[ZODB-Dev] Objects containing references to other objects

Jeff Kowalczyk jtk@adelphia.net
Tue, 5 Jun 2001 08:19:27 -0400


If you have an object (say "person") who might have other objects of
various classes (other person, appointment, purchaseorder, todo, etc.)
that should be linked to them in some way, what does a ZDB user
typically do?

Modeling the objects as children/collections won't work for me. Most of
these other objects would be first-class objects that have application
features elsewhere in the system, and other locations. 

For example, a purchase order system might be a standalone applet, but
you still want the 'company' field to point to an object in your
separate contact database of company-class objects. Likewise, you'd want
persons to point to their company object, if they have one.

Aside from app structure, the secondary point of this line of
questioning is to determine what and ODB/ZDB user does to prevent
objects from having (possibly misspelled) text strings for names of
objects that live elsewhere in the system. A string for your person or
company name in the Purchase order is not as useful as the true
ObjectID.

I guess its still a holdover from my RDBMS mindset, but I'm not ready to
give up normalization with ID's when I take the plunge into an ODBMS
like zope. Do I have to, or does storing objectID's work? Does this
explode into a complexity of object lifetimes that takes all the fun and
practicality out of using Zope?