Re: Getters without the "get" part
Re: Getters without the "get" part
- Subject: Re: Getters without the "get" part
- From: Sacha Michel Mallais <email@hidden>
- Date: Tue, 31 Mar 2009 13:23:42 -0700
On Mar 31, 2009, at 1:04 PM, Mike Schrag wrote:
Heh - and while we're at it, let's replace NSArray with
ArrayList, NSDictionary with HashMap and NSSet with .... well,
some of those gazillion java collection classes....
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.
Agreed. Foundation collections are an embarrassing relic.
Unfortunately, the standard Java collection classes (JCC) gloss
over an important aspect of collection classes: mutability vs.
immutability. EOF requires the latter for all attributes, so
switching to JCC in EOF would be dangerous, and, IMHO, foolish.
AFAIK, the only benefit to using standard JCC is to be more
"standard" Java... something I'd like but am willing live without
in order to gain the benefit of EOF.
performance ... under heavy load, the java collections classes in
specific parts of WO/EOF perform much better. one could make the
case that NSDict/MutableDict should instead extend HashMap,
though. Unfortunately to play nicely with other API's, they still
impl Map/List, which means that even now we lose our immutable
API's. Personally, I still use the NS API's even though Map/List
is available explicitly so I get proper immutability compile time
checks.
Fair enough: being able to choose the implementation is a Good
Thing. I guess I subscribe to the "make it right, then make it good,
then make it fast" philosophy, and in that respect, the standard JCC
-- and some of the JDK as a whole -- give me butt rash.
Furthermore, IMHO, the standard JCC are more embarrassing than the
WO ones. How many redesigns have the standard JCC had? How many
redesigns have the WO ones had? Certainly the WO design has stood
the test of time, and the Java ones have not. And we still have
Liskov-violating crap like java.util.Properties.
The Java collections' original design is abysmal. However, I think
the Java port of NS* would have been MUCH better served as
interfaces instead of implementations. Those classes fundamentally
don't allow the design of the original Objective-C classes to carry
over properly, and the port kind of messed things up in this
respect. Modern Java collections are actually pretty nice, save
the lack of immutable API's. The real power, to me, is that I can
choose my implementation for List/Map. This is particularly nice
with something like LinkedHashMap.
Agreed, using interfaces would have been superior. I would fully
support a change in that direction.
The standard JCC aren't bad, but are missing a key abstraction
(immutability)... I'd still probably choose the WO ones 95% of the
time (Principle of Least Surprise), but they are nice to have when
you need the performance.
sacha
--
Sacha Michel Mallais Senior Developer / President
Global Village Consulting Inc. http://www.global-village.net/
PGP Key ID: 7D757B65 AIM: smallais
A plan without a schedule is just a dream. -- Chuck Hill
_______________________________________________
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