[jdom-interest] a question about node type

Tatu Saloranta cowtowncoder at yahoo.com
Wed Dec 6 22:14:08 PST 2006


--- Syloke Soong <ssoong at protedyne.com> wrote:

> [quote]
> instanceof is reflection and reflection is slow :).
> [/quote]
> 
> Omg[osh], I've got instanceof operator all over the
> place. Though it
> seems my IO operations that are slowing my apps
> down.

The original claim was pure BS. instanceof is a rather
fast operation, requiring just simple lookups by JVM.
The main problem with instanceof is not performance
but that using it (or reliance on) is often sign of
bad design.

As to not having basic Node type, well, as far as I
know that was a fundamental conscious decision by JDom
authors, back in the day ("seemed like a good idea
back then"). Other tree models do use such a base
class or interface, so those who prefer such an
approach could have a look at Dom4j or XOM.

-+ Tatu +-



 
____________________________________________________________________________________
Want to start your own business?
Learn how on Yahoo! Small Business.
http://smallbusiness.yahoo.com/r-index


More information about the jdom-interest mailing list