[jdom-interest] instanceof

Michael Kay mike at saxonica.com
Mon Jan 22 14:16:42 PST 2007

> I think use instanceof in java seems as anti-OO as the use of peace 
> wreath for xmas is anti-American.

Since you haven't revealed your views on the latter, I have difficulty
knowing your views on the former...

> I have not much choice but to test each iterator member with 
> instanceof, do I?

You often have no choice but to use instanceof. That's a legitimate
criticism of the API you are using. It's not a legitimate criticism of your
code: the API design forces you into it.

Michael Kay

More information about the jdom-interest mailing list