[jdom-interest] JDOM && Jaxen

Elliotte Rusty Harold elharo at metalab.unc.edu
Fri Aug 3 04:19:07 PDT 2001


At 5:08 PM +0200 8/2/01, Szegedi Attila wrote:

>This definition (which, IMHO should be part of the XML InfoSet spec rather
>than the XPath spec) clearly speaks against flyweights.

No, I don't think it does. The whole point of the flyweight design pattern is that the client typically doesn't know and doesn't care that all the different namespace information items are in fact represented by the same object. We could rewrite JDOM not to use flyweights, and keep exactly the same public API we have now.  No client code would need to change. 

The one thing a non-flyweight would let us do that we don't do now is add a getParent() method to Namespace, though frankly unless we got a Node interface as well and some other XPath functionality, I don't think it's worth it. 
-- 

+-----------------------+------------------------+-------------------+
| Elliotte Rusty Harold | elharo at metalab.unc.edu | Writer/Programmer |
+-----------------------+------------------------+-------------------+ 
|          The XML Bible, 2nd Edition (Hungry Minds, 2001)           |
|              http://www.ibiblio.org/xml/books/bible2/              |
|   http://www.amazon.com/exec/obidos/ISBN=0764547607/cafeaulaitA/   |
+----------------------------------+---------------------------------+
|  Read Cafe au Lait for Java News:  http://www.cafeaulait.org/      | 
|  Read Cafe con Leche for XML News: http://www.ibiblio.org/xml/     |
+----------------------------------+---------------------------------+



More information about the jdom-interest mailing list