[jdom-interest] JDOM JSR

Elliotte Rusty Harold elharo at metalab.unc.edu
Sat May 19 04:51:32 PDT 2001


At 12:36 PM -0700 5/18/01, Jason Hunter wrote:


>The problem is that the number of methods which JDOM objects have in
>common or could have in common is close to zero.  Therefore to create a
>Node we have to either allow methods which don't make sense for all
>objects (like getMixedContent() on Attribute) or we have Node as really
>just a marker interface.  Myself, I don't want to see non-sensical
>methods because that's one of the core problems with DOM.  And I don't
>see sufficient value for Node as just a marker interface for reasons
>enumerated before.
>

I don't agree that that's a problem with DOM. I think the problem 
with DOM is that there are too many methods in the Node interface, 
and that the ones that are there often have the wrong semantics. 
(e.g. getNodeValue() returning null for all element nodes)

I'm perfectly willing to have getMixedContent() on an Attribute 
return an empty list. However, that's really a canard because any 
time you were walking a tree and didn't know the types of things you 
wouldn't bump into attributes anyway. They're not children.
-- 

+-----------------------+------------------------+-------------------+
| 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