Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: [xml-dev] SAXException, checked, buy why?

From: Alan Gutierrez <alan-xml-dev@-----.--->
To: David Megginson <david.megginson@-----.--->
Date: 1/2/2005 2:08:00 PM
* David Megginson <david.megginson@g...> [2005-01-01 22:03]:
> On Sat, 1 Jan 2005 19:42:20 -0500, Alan Gutierrez
> <alan-xml-dev@e...> wrote:
> 
> >     What was the thinking behind making SAXException a checked
> >     exception?
> 
> We talked about a few different strategies -- having all of the
> callbacks throw Exception, having SAXException extend
> RuntimeException, and having SAXException as a distinct base type.  
> No one less than James Gosling got in touch with me through an
> intermediary to argue against throwing Exception.  RuntimeException
> was generally felt not to be the Java way (after all, IOException is
> checked, and XML parsing is a kind of IO).
> 
> My single greatest regret about SAX, and one that I can never fix
> without breaking backwards compatibility, is not having SAXException
> extend IOException.  I originally wanted to, but was too easily talked
> out of it.

    I'm going to get rid of checked exceptions. It just occured to
    me why they don't make sense in the case of SAX.

    SAX is a observer pattern. The logic is defined as a bunch of
    callbacks. The contents of the callbacks are specific to the
    application implementing the call backs. The exception thrown is
    unlikely to be a SAXException, since SAX is so simple. It is
    either a parse exception or an application exception.

    Checked exceptions might make sense on the IO library, because
    the exception will originate from within the IO library, not
    beyond the IO library.

    In STAX, an iterator pattern, a checked STAXException, makes
    a lot more sense.

--
Alan Gutierrez - alan@e...


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent