[Zope3-dev] Associations

Jeffrey P Shell jeffrey@cuemedia.com
Wed, 23 Jan 2002 15:41:13 -0700


A frustrating thing about designing in Zope/ZODB is the difficulty of doing
non-containment relationships.  While paths *can* be used to refer and get
to other objects within Zope, the folder-like nature of Zope makes it
natural to do various move operations (cut/paste, rename) that end up
invalidating any path reference to a particular object.  This is a common
grievance, causing many people (myself included) to implement their own
quick solutions to the problem by taking various approaches (see the
comments area for the ExplicitObjectReferences proposal [1]).

For example, I'm developing a business object application based on the CMF,
and I'm getting to the point where I have to start working on our billing
system.  A billing invoice needs to refer to its customer, and will be
associated with various tasks completed in that billing period [2].  In a
relational database, this is mind-numbingly easy.  Not only is it easy to
make a references table, but in most databases it's easy to put some sort of
rules and constraints on the relationship (primarily in regards to
deletion).  In Zope, this is hard, especially where move operations are
common.  In the projects/tasks/invoices scenario, after a certain period of
time projects might get moved to an Archives folder.  The billing invoices
still need to keep their references to the tasks in that project.

>From the perspectives of both a component developer and an application
integrator, how might the references be updated so that a business rule like
"once a task is referenced by an invoice, that task must *always* be
reachable from the invoice" can be enforced?  Are there any existing
notions?

..[1] http://dev.zope.org/Wikis/DevSite/Proposals/ExplicitObjectReferences
..[2] http://www.zope.org/Members/jshell/relations.jpg

-- 
Jeffrey P Shell 
www.cuemedia.com


Sent using the Entourage X Test Drive.