Re: Sorting fetch results by calculated value...
Re: Sorting fetch results by calculated value...
- Subject: Re: Sorting fetch results by calculated value...
- From: Cornelius Jaeger <email@hidden>
- Date: Fri, 16 Jan 2004 18:44:15 +0100
would notifications work for you,
i use it to pass information from my eo's to session and back.
you can use the userinfo dictionary to pass values.
hth
cornelius
On Jan 16, 2004, at 6:19 PM, Frangois Frisch wrote:
Yes, certainly. It uses KVC to get the values. See the
EOSortOrdering
methods sortArrayUsingKeyOrderArray and
sortedArrayUsingKeyOrderArray.
You might want to consider caching the value after the first
calculation if
the process is time consuming and / or you are sorting a lot of
objects.
Thanks for the advice, Chuck. Here's my conundrum: This calculation
(currently being done in the component) is based on information about
the user, which is pulled from the session. There's a little red
light going off in my head at the thought of putting a call to the
session in an Enterprise object method. But, frankly, I can't think
of a way to redesign it without going to the session yet still making
it look like an accessor method.
Don't suppose you have any thoughts on that?
I would create an interface called EOObjectSorter (or what ever you
get the idea) which has the methods you need in the EO . Then you make
the Session implement this.
The result is that the EO doesn't need know it's using the session.
Now the problem is that you will still need to pass the session to the
EO when you call the method. just wrap it in a method that doesn't
have argument in your component (or a controller class).
_______________________________________________
WebObjects-dev mailing list
email@hidden
http://www.omnigroup.com/mailman/listinfo/webobjects-dev
_______________________________________________
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.