• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Getters without the "get" part
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Getters without the "get" part


  • Subject: Re: Getters without the "get" part
  • From: Hugi Thordarson <email@hidden>
  • Date: Tue, 31 Mar 2009 20:33:43 +0000

Oh yes, the Java collections do indeed suck :-).

- hugi




On 31.3.2009, at 20:27, Mike Schrag wrote:

This already should have happened. Once you get a firm grasp of the Java Collections API, it's design, intention and power, NSArray and it's company will make you want to puke. I actually thought that WO would move in this direction by first making NSArray implement List, and do all the similar stuff, then depreciate Foundation collections, and the finally get rid of them. Well, maybe that still is the intention, but it sure is slow.
The lack of power sucks, but the lack of immutable forms of the List/Map/Set interfaces in Java is a failure IMO. WO/EOF moving to straight List/Map/Set would suffer from a loss in clarity as a result. On the flip side, it would gain the performance and flexibility of the Java collections APIs, which is a win. I'm definitely conflicted on the correct answer to this conundrum.
Also, you lose a lot of really nice methods on the immutable ones like arrayByAddingObject ...
Hey, just create ERXArrayUtilities.arrayByAddingObject( Object[] array, Object object )

we don't need an entire new collection API for methods like this :-).
Awesome ... more crappy java-style non-OO methods. In particular, have fun implementing this properly with the first param being a List<T>

List<T> listByAddingObject(List<T> list, T obj)

Keep in mind:
1) List doesn't implement clone()
2) You really want the same class of List that got passed in
3) You don't know that the class provided has an empty constructor
4) Constructing a List with an existing List or Array may be a big performance gain


There's no good implementation of this method (funny timing because I just starting writing this method about 15 minutes ago). The proper implementation is that the class itself should provide an optimized way of implementing this.

_______________________________________________ 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
References: 
 >Re: Getters without the "get" part (From: Chuck Hill <email@hidden>)
 >Re: Getters without the "get" part (From: TW <email@hidden>)
 >Re: Getters without the "get" part (From: Simon McLean <email@hidden>)
 >Re: Getters without the "get" part (From: Chuck Hill <email@hidden>)
 >Re: Getters without the "get" part (From: Dan Grec <email@hidden>)
 >Re: Getters without the "get" part (From: Chuck Hill <email@hidden>)
 >Re: Getters without the "get" part (From: Mike Schrag <email@hidden>)
 >Re: Getters without the "get" part (From: Anjo Krank <email@hidden>)
 >Re: Getters without the "get" part (From: Hugi Thordarson <email@hidden>)
 >Re: Getters without the "get" part (From: Stamenkovic Florijan <email@hidden>)
 >Re: Getters without the "get" part (From: Mike Schrag <email@hidden>)
 >Re: Getters without the "get" part (From: Mike Schrag <email@hidden>)
 >Re: Getters without the "get" part (From: Hugi Thordarson <email@hidden>)
 >Re: Getters without the "get" part (From: Mike Schrag <email@hidden>)

  • Prev by Date: Re: Getters without the "get" part
  • Next by Date: Re: Getters without the "get" part
  • Previous by thread: Re: Getters without the "get" part
  • Next by thread: Re: Getters without the "get" part
  • Index(es):
    • Date
    • Thread