[jdom-interest] Re: Fast or Safe?

Jason Hunter jhunter at collab.net
Sun Sep 3 14:22:06 PDT 2000

> I love JDOM!!!! 

Me too.  :-)

>  Have two new interfaces IElement and IAttribute that return 
> IElements and IAttributes instead of Elements and Attributes

You can look to DOM for what the interface/factory model makes you do. 
For example, you can't just move an element from one doc to another, you
have to "import" the element.  You also have to use an existing document
to create a new element (document acts as the factory, making sure all
elts on a doc are of the same type).  What a pain.  I suspect a JDOM
interface/factory model would fall down the same pit.  Maybe a JDOM
baseclass/factory model would fare better, but I don't like the idea of
factories to handle core tasks unless it's 110% required to achieve a
base goal.

Simon's follow-on post about "having cake and eating it too" is closer
to what I think could be workable.  The issue is, if you create a
thread-safe implementation with SAXBuilder, how do you make sure that
the document stays thread-safe?  Only way is to do as DOM does and use
document as a factory and import content instead of directly adding
objects.  Ugh.  Is it really worth it?  I don't think so.  Hmm...


More information about the jdom-interest mailing list