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 protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to