[Zope-dev] Re: [Zope3-dev] PROPOSAL: ZODB Relationships
Roché Compaan
roche@upfrontsystems.co.za
Fri, 9 May 2003 11:28:39 +0200
On Thu, 08 May 2003 19:58:22 -0400
"Phillip J. Eby" <pje@telecommunity.com> wrote:
> 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 th=
e
> "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()'. Th=
at
> won't work.
What we have at the moment is a graph and strictly speaking a graph has
no direction in its edges (maybe you meant directed graph). As far as I
can see graphs are possible, hierarchies are not. Can't one just use
containment to represent hierarchies? If one can what other use cases
are there for directionality in associations?
> 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 BTre=
e,
> relationships might be a nice tool to have available in the ZODB library.
>
> A final comment... Once this takes directionality into consideration, yo=
u
> 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'.
We used the term Relationship because the proposal is based on the
entity-relationship model. I am not too familiar with MOF so maybe you
can explain how it will apply to the current proposal. Thanks for your
comments Phillip. I was hoping you say something because you must have
thought about this when designing PEAK.
--
Roché Compaan
Upfront Systems http://www.upfrontsystems.co.za