|
From: Oliver H. <Ol...@ou...> - 2005-07-22 02:21:39
|
Actually I see this is only the case for ComparableComparator (I've got to many versions of the code open at the moment) the NullSafeComparator and BooleanComparator singletons are still there.=20 My question still stands through.=20 Oliver > -----Original Message----- > From: spr...@li...=20 > [mailto:spr...@li...] > On Behalf Of Oliver Hutchison > Sent: Friday, 22 July 2005 10:32 AM > To: spr...@li... > Subject: [Springframework-developer] Comparator singletons MIA? >=20 > Jurgen,=20 >=20 > I've just started upgrading Spring Rich to the latest spring=20 > code base and noticed that all of the Comparator singletons=20 > (which Spring Rich uses a lot) in the o.s.util.comparator=20 > package have been removed.=20 >=20 > These classes are IMHO perfect examples of where you should=20 > be using a singleton. Given that every instance will exhibit=20 > exactly the same behaviour, why would you ever want to have=20 > more that one instance of a class like ComparableComparator?=20 > Also how much cleaner is this: >=20 > ComparableComparator.nullSafeInstance().compare(argument1, argument2) >=20 > to this? >=20 > new NullSafeComparator(new ComparableComparator(),=20 > true).compare(argument1, argument2) >=20 > and more performant to boot. >=20 > Anyway, obviously I can live without them, but I'm curious=20 > about the rational behind the removal?=20 >=20 > Thanks, >=20 > Oliver >=20 >=20 >=20 > ------------------------------------------------------- > SF.Net email is sponsored by: Discover Easy Linux Migration=20 > Strategies from IBM. Find simple to follow Roadmaps,=20 > straightforward articles, informative Webcasts and more! Get=20 > everything you need to get up to speed, fast.=20 > http://ads.osdn.com/?ad_idt77&alloc_id=16492&op=3Dick > _______________________________________________ > Springframework-developer mailing list > Spr...@li... > https://lists.sourceforge.net/lists/listinfo/springframework-developer >=20 |