[jdom-interest] My remarks about JDOM B9

Elliotte Rusty Harold elharo at metalab.unc.edu
Thu Apr 17 08:41:47 PDT 2003


At 11:01 AM +0200 4/17/03, phil at triloggroup.com wrote:


>=> SAXBuilder now throws an IOException
>>From a design point of view, this violates the notion of library 
>>isolation, where only one kind of exception should be
>thrown (JDOMException, in our case).

I think it's OK for JDOM to depend on standard Java libraries such as 
java.io. In fact, it really couldn't be otherwise since we accept 
java.io.InputStreams and java.io.Readers as method arguments. It just 
makes sense to throw an IOException for an I/O error.

>I noticed that JDOMException currently has a an 'initCause' method 
>and this should
>be used instead of throwing an IOException, which is directly tied 
>to the implementation. JDOMException should also
>provide a constructor that takes an embedded exception, to 
>facilitate that pattern.

That constructor might be a useful addition on its own merit in 
post-b9, but I don't think we should be using it here.

-- 

+-----------------------+------------------------+-------------------+
| Elliotte Rusty Harold | elharo at metalab.unc.edu | Writer/Programmer |
+-----------------------+------------------------+-------------------+
|           Processing XML with Java (Addison-Wesley, 2002)          |
|              http://www.cafeconleche.org/books/xmljava             |
| http://www.amazon.com/exec/obidos/ISBN%3D0201771861/cafeaulaitA  |
+----------------------------------+---------------------------------+
|  Read Cafe au Lait for Java News:  http://www.cafeaulait.org/      |
|  Read Cafe con Leche for XML News: http://www.cafeconleche.org/    |
+----------------------------------+---------------------------------+



More information about the jdom-interest mailing list