jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Müller <thomas.muel...@day.com>
Subject Re: Generics generator class
Date Wed, 06 May 2009 10:15:14 GMT

We all agree that the public part of a class (public and protected
methods) should use interfaces where possible.

How private things are declared within a method or class is more a
cosmetic thing, similar to how to name variables. I prefer 'declare as
HashMap' because of performance and simplicity, others prefer 'declare
as Map', that's fine with me.

> If you don't have numbers, don't claim performance gains....

I do have numbers. But you wrote that you anyway don't care about them
- that's why I didn't provide them yet ;-)

> which has no link to the other thread

That's true, maybe we should split the thread. Toby started with 'Map
versus HashMap' thing.

> So if your code just uses a map, why declare it a HashMap -- you might later decide
> to use a GrokMap or a StupidMap instead of HashMap and you don't want to
> change your code except for the constructor, do you ?

Well, I rarely do things like this, but if I do, I also change only
one line (the declaration, and the instantiation).


View raw message