[jdom-interest] Fast Factory

Bradley S. Huffman hip at csa.cs.okstate.edu
Tue May 27 09:20:53 PDT 2003


Elliotte Rusty Harold writes:

> At 3:55 PM -0500 5/26/03, Bradley S. Huffman wrote:
> 
> >One of the problems with FastFactory as written, and extending JDOM objects
> >in general, is it depends heavily on protected fields. Maybe it's time
> >to make all inner fields private and put protected static constructor method
> s
> >in all JDOM classes (damn, there goes that method count up again :(  The
> >creation methods can skip verification, but the normal constructors
> >and set* methods would still call Verifier (guess they could even be made
> >final).  Sort of a compromise, quick creation for those special cases like
> >building from SAX, otherwise verify on normal creation or any changes
> >to a object.
> 
> Instead of making them protected you could make them package 
> protected. This allows them to be used from the factory class, while 
> complicating the public API not a whit. This does require making the 
> factory part of org.jdom instead of org.jdom.input, but I think 
> that's a good idea anyway.

But FastFactory would still have to be public for SAXBuilder to use it as
the default factory.  Guess could always change JDOMFactory from a interface
to a class, and move it into org.jdom.

Brad



More information about the jdom-interest mailing list