Hi Peter

Sorry, that question slipped away under my fingers. But thanks, Kevin,
for this excellent answer. I couldn't have done it better. So if I may
provide a short answer to your question and to sum up the mail by Kevin:
IMO the cost, if any, is by far not enough to outweigh the benefits
(code readability, clear design, maintenance costs etc) of using the
interface instead of the implementation. And I agree that instanceof is
to be used with caution.

On Mon, 11 Nov 2002 09:18:44 +1000 Peter B. West wrote:
> Jeremias,
> 
> This was a serious question, really.  Joerg, when he gets back, might 
> like to comment on this, because it was as a result of some of his input 
> that I first realised there was a significant cost associated with such 
> Java fundamentals as instanceof and type casting.  Those discussions 
> gave me much food for thought.  So I'll rephrase the question: what, if 
> anything, is the cost of using the interface instead of the implementation?
> 
> Peter
> 
> Peter B. West wrote:
>  > Jeremias,
>  >
>  > I have no objection at all, as long as it costs nothing.  It is free,
>  > isn't it?
>  >
>  > Jeremias Maerki wrote:
>  >
>  >> Fellow FOP developers,
>  >>
>  >> would you mind using the interface instead of the implementation where
>  >> possible? Map instead of HashMap, List instead of ArrayList. I've seen
>  >> this habit in a number of places and not only by Keiron! I've made it a
>  >> habit to follow this pattern


Jeremias Maerki


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

Reply via email to