--- Janek Bogucki <[EMAIL PROTECTED]> wrote:
> On Mon, 2003-11-24 at 10:15, David Graham wrote:
> > 
> > --- Janek Bogucki <[EMAIL PROTECTED]> wrote:
> > > On Sun, 2003-11-23 at 21:53, Phil Steitz wrote:
> > > > A few weeks back, David Graham submitted code for a 
> > > > CaseInsensitiveHashMap here:
> > > > 
> > > > http://nagoya.apache.org/bugzilla/show_bug.cgi?id=24537
> > > > 
> > > > This looks like a good addition to [collections] to me.
> > > > 
> > > > Any objections to my coding up some tests and adding this class to
> the
> > > 
> > > > map package?
> > > > 
> > > > Phil
> > 
> > > 
> > > It might be best to use an instance of
> o.a.c.c.decorators.TransformedMap
> > > with a lower case key transformer and a null value transformer to
> > > implement this class. Even though the posted implementation is
> simple,
> > > using the decorator removes the need to have the 'plumbing' code
> > > currently present -- and illustrates the use of the collections
> library.
> > > 
> > 
> > That's a good idea.  I was not aware of TransformedMap or the
> Transformer
> > interface.  It seems like they were designed to avoid writing classes
> like
> > CaseInsensitiveHashMap :-).  However, it only transforms objects on
> put()
> > calls and not on get().  That behavior would need to change.
> > 
> > David
> > 
> 
> Umm, I didn't notice #get did not apply the transformation. Perhaps not
> such a good idea to use TransformedMap after all.
> 
> This behaviour is certainly different to my expectations (although the
> documentation is clear enough on this point). I wonder what the original
> use-case for TransformedMap was.
> 
> If the database client code restricts itself to using lowercase names
> (an aspect you are in control of) TransformedMap could still be useful
> but hardly as convenient as the original case insensitive map.

It's a requirement that DbUtils clients use whatever case they want to
refer to column names in a Map so TransformedMap as it is now won't work.

Regardless, DbUtils doesn't have a dependency on collections and shouldn't
add one just for this feature.  The implementation of
CaseInsensitiveHashMap is trivial enough to maintain in DbUtils.  I opened
the enhancement against collections in case anyone else had a need for
this kind of Map.  If TransformedMap doesn't change then I think adding
CaseInsensitiveMap is the best solution.

> 
> -Janek
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


__________________________________
Do you Yahoo!?
Free Pop-Up Blocker - Get it now
http://companion.yahoo.com/

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to