|
From: Juergen H. <ju...@in...> - 2005-07-22 08:12:03
|
NullSafeComparator has two such singletons: NULLS_LOW and NULLS_HIGH, = each using a ComparableComparator underneath. I guess you could simply use = those singletons rather than one on ComparableComparator itself. Juergen =20 -----Original Message----- From: spr...@li... [mailto:spr...@li...] On Behalf = Of Oliver Hutchison Sent: Friday, July 22, 2005 4:22 AM To: spr...@li... Subject: RE: [Springframework-developer] Comparator singletons MIA? 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... > [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 > I've just started upgrading Spring Rich to the latest spring code base = > and noticed that all of the Comparator singletons (which Spring Rich=20 > uses a lot) in the o.s.util.comparator package have been removed. >=20 > These classes are IMHO perfect examples of where you should be using a = > singleton. Given that every instance will exhibit exactly the same=20 > behaviour, why would you ever want to have more that one instance of a = > class like ComparableComparator? > 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 about the=20 > rational behind the removal? >=20 > Thanks, >=20 > Oliver >=20 >=20 >=20 > ------------------------------------------------------- > SF.Net email is sponsored by: Discover Easy Linux Migration Strategies = > from IBM. Find simple to follow Roadmaps, straightforward articles,=20 > informative Webcasts and more! Get everything you need to get up to=20 > speed, fast. > http://ads.osdn.com/?ad_idt77&alloc_id=16492&op=3Dick > _______________________________________________ > Springframework-developer mailing list=20 > Spr...@li... > https://lists.sourceforge.net/lists/listinfo/springframework-developer >=20 ------------------------------------------------------- SF.Net email is sponsored by: Discover Easy Linux Migration Strategies = from IBM. Find simple to follow Roadmaps, straightforward articles, = informative Webcasts and more! Get everything you need to get up to speed, fast. 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 |