Re: Custom EOSortOrdering for a WODisplayGroup
Re: Custom EOSortOrdering for a WODisplayGroup
- Subject: Re: Custom EOSortOrdering for a WODisplayGroup
- From: Paul Hoadley <email@hidden>
- Date: Fri, 7 May 2010 17:50:56 +0930
On 07/05/2010, at 4:01 PM, Johann Werner wrote:
>>> 2. Change the Java type of that attribute to some custom type (that presumably includes a String by composition), implement the sorting algorithm for that type, and register that for global use as described. (Is that even feasible? Sounds like a lot of work.)
>>
>> I think I could make a good case for that being the right answer. Maybe not the easy answer, but right.
>
> I would consider that option too. You have to bear in mind that if you change the comparator globally for all String objects you can considerably slow down your app if you are doing expensive things like using pattern matching and all that kind of stuff, especially when working with big arrays. Though it could be negligible in a small app.
> I think the ideal implementation would be to keep the normal String prototype in your model (as your model could be reused in other apps that don't need the custom sorting) and change it programmatically to your custom subclass of String in the constructor/initializer of your custom comparator.
Thanks for this. Thanks to all who replied—very helpful.
--
Paul.
http://logicsquad.net/
_______________________________________________
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