[jdom-interest] Re: Node interface

Jason Hunter jhunter at xquery.com
Thu Sep 9 18:20:21 PDT 2004

> The reason a "Node" interface is of so much iterest to me is that I can
> then have JDOM-related type-safety in my own code that utilizes JDOM's
> classes: you may not see the reason for it within JDOM but not having a
> common "placeholder" interface for your JDOM classes makes my client
> code ugly and un-type-safe (having to pass Objects around instead of
> JDOM Nodes which means anything can be passed to my methods and that we
> have to rely too heavily on javadoc and runtime debugging to "guide" the
> usage of our code).

Interesting point.  So you want to hold a "JDOM Object" in your code but 
there's no such type.  I can see that.

> I'm hoping it's not too late to add this sort of placeholder interface
> to JDOM 1.0 (after all, "all" you have to do is create the interface,
> check and replace the relevant Object usages in your JDOM method
> signatures and method bodies, make your relevant interfaces and classes
> extend/implement this interface and away we all go!). There's no reason
> why you can't make Parent and Child co-exist with a Node interface.
> What do you think?

It's too late to add a new base interface type at this point.  It would 
require too much testing to make sure it didn't have odd side effects. 
But like you say, we should be able to add it in a backward compatible 
way so it's a 1.1 feature idea.


More information about the jdom-interest mailing list