Re: Any Checkstyle users?
- From: "Daniel Dyer" <dan@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 31 Jan 2006 11:04:17 -0000
On Tue, 31 Jan 2006 05:03:43 -0000, Roedy Green <my_email_is_posted_on_my_website@xxxxxxxxxxxxxx> wrote:
On Tue, 31 Jan 2006 14:18:38 +1000, "Tony Morris" <not@xxxxxxxxxxx> wrote, quoted or indirectly quoted someone who said :
You should be using a Map reference. All aside from the false assumption that HashMap is indeed useful.
Does that buy you anything other than it prevents you write locking yourself into ArrayList by using non-Map methods?
Not sure what you mean by "write locking yourself into ArrayList". I would have thought the main advantages are that you can switch implementations (for example change from HashMap to TreeMap) without having to change any other code. The corrollary of that is that it prevents your logic from becoming polluted by details of the current implementation.
I'm interested in Tony's point about HashMap not being useful. What do you mean by this?
The penalty is you are using slower interface references rather that direct class ones which require a much more convoluted scheme to find the appropriate method on each call.
You would have to have some convincing evidence of a significant performance hit before I would take that into consideration. This is another one of those micro-optimisations that is best left to the compiler or VM.
Dan.
-- Daniel Dyer http://www.dandyer.co.uk .
- Follow-Ups:
- Re: Any Checkstyle users?
- From: Roedy Green
- Re: Any Checkstyle users?
- References:
- Any Checkstyle users?
- From: slippymississippi
- Re: Any Checkstyle users?
- From: mikm
- Re: Any Checkstyle users?
- From: mikm
- Re: Any Checkstyle users?
- From: Tony Morris
- Re: Any Checkstyle users?
- From: Roedy Green
- Any Checkstyle users?
- Prev by Date: Re: platform's default charset ?
- Next by Date: Re: platform's default charset ?
- Previous by thread: Re: Any Checkstyle users?
- Next by thread: Re: Any Checkstyle users?
- Index(es):