Hi Charles,

Welcome!


On May 7, 2009, at 5:20 PM, Charles Young wrote:

Hi

I'm sure I have a commonly seen issue:

I have a many to many relationship between tables SOURCE and DEST. This is implemented by a third table GLUE which contains the PKs of SOURCE and DEST as well as an integer property (order) that describes the order of DESTs with respect to SOURCE.

This might not be so common. A more common thing is to order them by an attribute of DEST.



I'd like to flatten the relationship such that I can call a method like:

source.dests() -> NSArray <Dest>

where the array is ordered by source.glue.order().

I've written a simple method that grabs source.glue(), sorts it on glue.order() and then iterates to extract dest, but I'm sure this issue has been solved many, many times before in a cleaner and more elegant manner.

I can't think of another way. You could encapsulate this in a generic method using Key-Value coding so that you only had to write it once.


On a separate subject thanks to all for a very interesting and informative group. I've been lurking for some time and have been enjoying the various conversations.


:-)


Chuck


--
Chuck Hill             Senior Consultant / VP Development

Come to WOWODC'09 in San Fran this June!
http://www.wocommunity.org/wowodc09/

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to