Re: [SOLVED] Re: Sort problem
Re: [SOLVED] Re: Sort problem
- Subject: Re: [SOLVED] Re: Sort problem
- From: David Holt <email@hidden>
- Date: Fri, 15 Apr 2005 15:22:38 -0700
Thanks Art,
You are right of course, the lastpost is recalculated for each topic
with every screen refresh. I have never cached objects to date, so I
will have to hit the books this weekend to learn about it. I appreciate
the suggestion,
David
On 15 Apr 2005, at 2:52 PM, Art Isbell wrote:
On Apr 15, 2005, at 11:43 AM, David Holt wrote:
EOSortOrdering timeOrdering =
EOSortOrdering.sortOrderingWithKey("lastPost.timestamp",
EOSortOrdering.CompareDescending);
If I understand your application logic correctly, each time you
invoke lastPost() as occurs in the above sort, the last post for each
Topic will be recomputed which might be expensive. You might want to
consider caching the last post to avoid unnecessary recomputations.
When a new post is added to a Topic, you could either set it to be the
last post (if that makes sense) or set the cached last post to null so
lastPost() will recompute it.
Aloha,
Art
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
email@hidden
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden