[Grok-dev] New Grok user with some questions

Leonardo Rochael Almeida leorochael at gmail.com
Tue Jun 24 17:45:29 EDT 2008


On Tue, Jun 24, 2008 at 16:59, Achim Domma <domma at procoders.net> wrote:
> [...]
>
> - One of my main problems with ZODB is how to implement m:n relations. I
> think most people comming from relational databases have this problem and a
> short how-to would be quite helpfull. Perhaps this would be a nice lighting
> talk on the Europython 2008? ;-)

M:N relationships are not a ZODB problem, but a Object Oriented
Programming problem, and it has a standard solution: Use a collection
of "relationship" objects, with 1:1 links to each relationship
participant, much like you would use a link table in a relational
database. Of course, there are some Zope 3 packages with ready-to-use
implementations of this pattern and I'll allow others to elaborate on
them.

BTW, it's "M:N relationships", not "M:N relations". "Relation" is the
mathematical term for a "table" in relational algebra. Relational
Databases have that name because they store "relations" (tables), not
because they make it easy to model "relationships" (which they don't,
people are just more used to the relational patterns for
relationships).

Cheers, Leo

PS: Sorry for the little pedantic trip, but it grates my nerves
everytime people get the "relation"/"relationship" thing wrong. I had
an excellent RDB teacher back in college and he was very insistent
about his students getting this detail right.  :-)


More information about the Grok-dev mailing list