[Zope-dev] Re: [Zope3-dev] PROPOSAL: ZODB Relationships

Phillip J. Eby pje@telecommunity.com
Thu, 08 May 2003 19:58:22 -0400


At 11:07 PM 5/8/03 +0200, roche@upfrontsystems.co.za wrote:
>We finally have a proposal out for ZODB relationships. This proposal
>presents an API for relationships, summarises ideas and contributions
>from a lot of people and was fuelled by the recent discussions about
>relationships on Zope3-dev and Zope-dev.
>
>     http://www.zope.org/Members/upfront/ZODBRelationships
>
>Your comments would be appreciated.

Issues:

1. "Global relationship repository" has no use cases, and smells like 
trouble.  Why not just explicitly store the Relationship() 
somewhere?  After all, every RelationshipView will have a reference to 
it.  (For ZODB4, a persistent module might be the natural place to put the 
"official" reference to the Relationship(); for ZODB3, just hang them off 
the root with suitably unique keys.)

2. There is no directionality to the associations; this doesn't work for 
hierarchies or graphs.  E.g. think 'parent_child = Relationship()'.  That 
won't work.

All in all, I don't see any reason to make this part of ZODB's API or add 
special repositories to support it.  However, like PersistentDict or BTree, 
relationships might be a nice tool to have available in the ZODB library.

A final comment...  Once this takes directionality into consideration, you 
might consider calling it an 'Association' rather than a 'Relationship', as 
it would then largely meet the MOF and UML semantics of an 
"Association".  That is, an association is a collection of directed links 
between objects.  It would then make sense to refer to refer to the 
'RelationshipView' as an 'AssociationEnd'.