[jdom-interest] Element Reference from Attribute

Elliotte Rusty Harold elharo at metalab.unc.edu
Sun Nov 19 07:46:30 PST 2000


Recently, as some of you know, I've been working on XInclude 
processors. This is the largest project I've tried to do in JDOM, and 
it's definitely changed my opinions about what is and isn't useful. 
At least in this use-case I'm seeing a lot more point to doing things 
the DOM way. In particular:

1. Everything needs to know its parent. I don't really care if that 
adds 4 bytes to each object.

2. Using Strings instead of a Text class is extremely inconvenient.

3. A Node interface or superclass would be a good thing.

These are pretty serious issues with the current design of JDOM. 
Unless they were fixed it would be a lot easier to design an XInclude 
processor with DOM than with JDOM.

However, there are still some aspects of JDOM that have proven to be 
useful or at least convenient in working with XInclude:

1. Classes instead of interfaces

2. Constructors instead of factories

3. Following Java coding conventions

4. Nodes that don't belong to any document are very useful.

On an unrelated note, I've also come to the conclusion that Java does 
need friend functions. There are a lot of cases where the 
org.jdom.input package and prg.jdom.output package classes have 
legitimate reasons to know more about the objects in org.jdom than 
are exposed through the public interface, but I'm not sure there's 
anything we can do to fix that. (Does anyone know a good design 
pattern that substitutes for friend functions?)
-- 

+-----------------------+------------------------+-------------------+
| Elliotte Rusty Harold | elharo at metalab.unc.edu | Writer/Programmer |
+-----------------------+------------------------+-------------------+
|                  The XML Bible (IDG Books, 1999)                   |
|              http://metalab.unc.edu/xml/books/bible/               |
|   http://www.amazon.com/exec/obidos/ISBN=0764532367/cafeaulaitA/   |
+----------------------------------+---------------------------------+
|  Read Cafe au Lait for Java News:  http://metalab.unc.edu/javafaq/ |
|  Read Cafe con Leche for XML News: http://metalab.unc.edu/xml/     |
+----------------------------------+---------------------------------+



More information about the jdom-interest mailing list