[Zope-dev] RFC: RelationAware class for relations between objects

Roché Compaan roche@upfrontsystems.co.za
Sat, 3 May 2003 16:49:40 +0200


* Shane Hathaway <shane@zope.com> [2003-05-02 20:48]:
> http://www.wikipedia.org/wiki/ER_diagram
> http://www.wikipedia.org/wiki/Mathematical_relation
> http://www.wikipedia.org/wiki/Relational_model
> 
> These pages don't mix up the two terms.  From what I understand now, 
> relation is simply the mathematical term for relationship.  Most people 
> think in terms of relationships since it's a useful, fuzzy term.  For 
> greater precision, mathematicians perform manipulations using relations.
> 
> Also, I was incorrect in mixing "relation" and "table".  The relational 
> data model seems to define relation a little differently than the 
> mathematical term, so it's better to just use the word "table" when 
> that's what I mean.
> 
> So here's what I was really trying to ask earlier: should we base the 
> API on the entity-relationship model or on the relational model?  The 
> entity-relationship model is quite simple, allowing you to translate a 
> drawing directly into code, but it limits the kinds of queries you can 
> make.  The relational model lets you formulate much more complex 
> queries, but at a higher buy-in cost.

I am not quite sure how either model can be the basis for the API? Both
models are conceptual tools for visualising data, relationships, etc.
Interestingly enough in one of the links you posted (the notes of Osmar
Zaiane) another data model is the object oriented data model. Isn't this
the most applicable model especially since we are working with the ZODB?

Both the entity-relationship model and the relational model has one
serious constraint. Entities in the e-r model and relations in the
relational model have a fixed schemas or fixed set of attributes.
Although this is true most of the time when dealing with objects one can
easily imagine cases where it is not like adding a property to an
instance of a folder.

Reading through the notes mentioned above two other terms struck a cord
especially since they are mentioned in the context of object databases.
In the notes on Chapter 8, "Object oriented databases" what we call a
relationship seems to be called a "reference" or persistent pointer.

    http://www.cs.sfu.ca/CC/354/zaiane/material/notes/Chapter8/node16.html

The other term is "association". Both terms are common and used in many
contexts and wont necessarily dry up the confusion but I thought I'll
throw them in the hat. I am inclined to "reference" since in an object
oriented world it makes much more sense to say attribute x of object y
is a reference to object z than attribute x of object y is a
relationship to object z.

Coming back to the problem statement, shouldn't it be as simple as "The
ZODB should be able to persist references?" or did I just take the wrong
turn?

-- 
Roché Compaan
Upfront Systems                 http://www.upfrontsystems.co.za