[Zope-dev] RFC: RelationAware class for relations between objects
Shane Hathaway
shane@zope.com
Fri, 02 May 2003 14:47:12 -0400
Shane Hathaway wrote:
> Roch=E9 Compaan wrote:
>> If you are that sure then the distinction is not that clear to me. I
>> understood "relation" as the *definition* of a logical association
>> between two objects and relationship as the association itself. Marria=
ge
>> is the relation, Peter's marriage to Susan is the relationship. Sure,
>> there is some overlap with "relation" in relational theory but we
>> describe the same thing: a logical association. When you use the word
>> "relation" you are referring to it as a specific storage implementatio=
n:
>> a table.
>=20
>=20
> Well, perhaps I am incorrect in my thinking, but every discussion I can=
=20
> Google (heh, I finally used Google as a verb) that mentions both the=20
> entity-relationship model and the relational model explains it=20
> differently. First they introduce ERM then explain how to implement it=
=20
> using relations in a relational database. ERM seems to be described as=
=20
> the underlying model for relations.
FWIW... Wikipedia helped.
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,=20
relation is simply the mathematical term for relationship. Most people=20
think in terms of relationships since it's a useful, fuzzy term. For=20
greater precision, mathematicians perform manipulations using relations.
Also, I was incorrect in mixing "relation" and "table". The relational=20
data model seems to define relation a little differently than the=20
mathematical term, so it's better to just use the word "table" when=20
that's what I mean.
So here's what I was really trying to ask earlier: should we base the=20
API on the entity-relationship model or on the relational model? The=20
entity-relationship model is quite simple, allowing you to translate a=20
drawing directly into code, but it limits the kinds of queries you can=20
make. The relational model lets you formulate much more complex=20
queries, but at a higher buy-in cost.
I'm leaning toward the entity-relationship model, since one of the=20
primary goals is simplicity. Besides, assuming we don't have to change=20
ZODB in order to get either feature, we could have both someday if we=20
needed them.
By the way, I just learned that Ted Codd, the father of relational=20
database technology, passed away two weeks ago. May he rest in peace.
http://www.intelligententerprise.com/online_only/features/030425.shtml
Shane