[jdom-interest] FactoryJDOM

Brett McLaughlin brett at newInstance.com
Tue Jun 26 08:51:16 PDT 2001


Hey-

  Just got through with the writeup of JDOMFactory and subclassing in JDOM
for my book (2nd edition), and had a couple of thoughts. While it's fairly
obvious how this works, and made explaining it easy, it's also a little
repetitive. I have to:

1) Code my subclass.

No big deal, perfectly normal, expected amount of work.

2) Code up a JDOMFactory implementation

This was the slight surprise. I expected to do something like:

factory.setElementClass("javaxml2.ORAElement");

rather than coding a complete subclass/implementation of
DefaultJDOMFactory/JDOMFactory. I understand with the multiple constructors,
you'd probably have to use reflection (since Class.forName().newInstance())
won't work in every case, but it would be awfully convenient if it was an
option.

Any thoughts from Ken and the other factory implementors?

-Brett




More information about the jdom-interest mailing list