Re: [Newbie]ManyToMany
Re: [Newbie]ManyToMany
- Subject: Re: [Newbie]ManyToMany
- From: David LeBer <email@hidden>
- Date: Wed, 17 Mar 2004 19:52:53 -0500
On 17-Mar-04, at 7:26 PM, Kieran Kelleher wrote:
Thanks for the experience tip. I am still on my first big project and
although EOModeler seems to allow this kind of flattening through an
object, I had not seen bad effects yet. I supose we must follow the
keypaths!
On Mar 17, 2004, at 6:44 PM, David LeBer wrote:
On 17-Mar-04, at 5:48 PM, Jonathan Rochkind wrote:
At 5:26 PM -0500 3/17/04, Kieran Kelleher wrote:
Forget having EoModeler make a many-to-many.
Just make relationships such as:
T1 <=>>T2 and T2<<=>T3, (where > is a to-one and >> is a to-many)
then you can use T1.T2.T3(), T3.T2.T1() and also use flattened
T1.T3() or T3.T1()
How could you use those flattened relationships from T1 to T3? Are
you suggesting defining the flattened relationship in the EOModel as
a class property, and ALSO defining the direct relationship as a
class property? I think this is rather a bad idea myself, but if
you've done it succesfully I'm interested in hearing about it.
Otherwise.... how could you "also use flattened T1.T3() or T3.T1()"?
My experience is you either use flattened relationships, or you
don't. If you don't (perhaps because you need exposed attributes in
the intermediary table), then you've got to go through the
intermediary table to get from T1 to T3 or vice versa.
--Jonathan
I concur, having a both flattened and unflattend relationships as
class properties at the same time is a bad thing. I know, I speak
from experience :-) Especially if you have a cascade delete rules in
place - mucho badness occurs.
Don't get me wrong, flattening an M2M relationship is fine (wonderful
in fact, one of the joys of EOF) if (and only if) you can treat the
"join" table as strictly a database artifact.
table1 -->> t1-2-t2 <<-- table2
Avoid making t1-2-t2 a class, and only expose the flattened
relationships in table1 and table2 as class properties.
It's when you have both flattened and unflattend relationships exposed
at the same time that bad things happen.
;david
--
David LeBer
Codebase Software Systems
site: http://www.codebase.ca
blog: http://david.codebase.ca
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.