[jdom-interest] Element Reference from Attribute

James Strachan james at metastuff.com
Mon Nov 20 03:51:18 PST 2000


----- Original Message -----
From: "Jerry Lawson" <jerry.lawson at virtualsummit.com>
> One more thing your SAXFactory would need:
>
>    public Document createDocument (Element root) {
>         return new Document (root);
>    }
>
>
> This would help those of us that require extending the Document class.

Well spotted. In the words of Homer - DOH!

> I'm not sure "SAXFactory" is a good name for this factory, though,
> since it is not really SAX-specific, but really JDOM specific.
> Maybe "JdomFactory" (or something similar) would be more appropriate.

The reason I called it SAXFactory was that it is SAX specific - it consists
entirely of factory methods used by the SAXBuilder / SAXHandler classes.
DOMBuilder would almost certainly have a different set of factory methods,
so would probably want its own DOMFactory implementation class.

So SAXFactory is the SAX factory of JDOM objects. Strictly speaking though
in Design Patterns speak, a "factory" object usually creates a single type
of object. So the name SAXFactory may be slightly misleading.  SAXFactory
behaves quite like java.awt.Toolkit does in AWT - it is a collection of
factory methods to create all of the JDOM object types for SAX. So maybe
SAXToolkit is a better name?

J.

James Strachan
=============
email: james at metastuff.com
web: http://www.metastuff.com




If you are not the addressee of this confidential e-mail and any
attachments, please delete it and inform the sender; unauthorised
redistribution or publication is prohibited. Views expressed are those of
the author and do not necessarily represent those of Citria Limited.



More information about the jdom-interest mailing list