[jdom-interest] Query regarding the Parent/Child interfaces.

Simon Gauld Simon.Gauld at three.co.uk
Sat Mar 20 02:06:26 PST 2004


Okay, lets put the difference of design behind us with respect to using the
instanceof keyword.

Do Child and Parent provide some much-needed functionality that Element
didn't already?

.s

-----Original Message-----
From: Elliotte Harold - java FAQ
To: Simon Gauld
Cc: jdom-interest at jdom.org
Sent: 19/03/2004 17:53
Subject: RE: [jdom-interest] Query regarding the Parent/Child interfaces.

On Wed, 17 Mar 2004, Simon Gauld wrote:

> Alex: I find it interesting that you believe using instanceof should
be
> avoided or minimized - this is a technique I find quite useful to be
able to
> derive general functionality - I wasn't aware it was something that
that
> should be avoided, and am somewhat confused as to why you say minimize
uses
> of it.
> 

In my experience instanceof is a perfomance sink. Any common method that

calls it is almost certainly a hot spot. I go to great lengths to aovid 
it. (Also frequent use of instanceof generally indicates a poorly
designed 
set of classes with insufficient use of polymorphism.)

--
Elliotte Rusty Harold     
elharo at metalab.unc.edu    
elharo at macfaq.com


________________________________________________________________________

This e-mail message (including any attachment) is intended only for the personal 
use of the recipient(s) named above. This message is confidential and may be 
legally privileged.  If you are not an intended recipient, you may not review, copy or 
distribute this message. If you have received this communication in error, please notify 
us immediately by e-mail and delete the original message.

Any views or opinions expressed in this message are those of the author only. 
Furthermore, this message (including any attachment) does not create any legally 
binding rights or obligations whatsoever, which may only be created by the exchange 
of hard copy documents signed by a duly authorised representative of Hutchison 
3G UK Limited.
________________________________________________________________________




More information about the jdom-interest mailing list