[jdom-interest] Fast Factory

Elliotte Rusty Harold elharo at metalab.unc.edu
Mon May 26 13:57:42 PDT 2003


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 methods
>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.
-- 

   Elliotte Rusty Harold
   elharo at metalab.unc.edu
   Processing XML with Java (Addison-Wesley, 2002)
   http://www.cafeconleche.org/books/xmljava
   http://www.amazon.com/exec/obidos/ISBN%3D0201771861/cafeaulaitA



More information about the jdom-interest mailing list