You are viewing a plain text version of this content. The canonical link for it is here.
Posted to general@xml.apache.org by Sc...@lotus.com on 2001/04/06 18:40:50 UTC

Exception Architecture (was Re: JDOM... etc.)

The problem is that those errors have to be reported through the pipeline.
So when I run the XSLT processor I need to report errors from the XML
processor.  Since JAXP 1.1 chose to specify TransformerException to be
generic from SAX or DOM or whatever, the SAX exceptions have to be wrapped
with Transformer exceptions.  And so it goes... checked exceptions can
cause dependencies all along the call chain, and often have to be wrapped
with some other exception anyway, and a runtime exception if you have to
pass the call through some API that you can't control.  And while checked
exceptions are very clear and specific, they can really add to the codesize
of the calling program.

If we change the DTM to use checked exceptions, I have to change about
4,000 lines of code in Xalan that used to call the DOM but now calls the
DTM to now handle the checked exceptions.  This is a fair amount of pain,
and I'm not sure what it will buy us.

-scott




                                                                                                                   
                    Andy Clark                                                                                     
                    <andyc@apache        To:     general@xml.apache.org                                            
                    .org>                cc:     (bcc: Scott Boag/CAM/Lotus)                                       
                                         Subject:     Re: JDOM in Apache (was Re: xml.apache.org charter proposal) 
                    04/06/01                                                                                       
                    05:36 PM                                                                                       
                    Please                                                                                         
                    respond to                                                                                     
                    general                                                                                        
                                                                                                                   
                                                                                                                   




Arnaud Le Hors wrote:
> My vote goes for runtime exceptions. I personally don't like static
> exceptions at all. I think the choice to catch an exception should
> always be left to the user...

I disagree. The types of errors that we're talking about are
not runtime variety of exceptions, they are XML processing
exceptions. I don't see a problem with explicitly declaring
what exceptions can be thrown and must be caught. I think
it's worse when left up to the user. Just my two yen.

--
Andy Clark * IBM, TRL - Japan * andyc@apache.org

---------------------------------------------------------------------
In case of troubles, e-mail:     webmaster@xml.apache.org
To unsubscribe, e-mail:          general-unsubscribe@xml.apache.org
For additional commands, e-mail: general-help@xml.apache.org






---------------------------------------------------------------------
In case of troubles, e-mail:     webmaster@xml.apache.org
To unsubscribe, e-mail:          general-unsubscribe@xml.apache.org
For additional commands, e-mail: general-help@xml.apache.org


Re: Exception Architecture (was Re: JDOM... etc.)

Posted by Andy Clark <an...@apache.org>.
Scott_Boag@lotus.com wrote:
> processor.  Since JAXP 1.1 chose to specify TransformerException to be
> generic from SAX or DOM or whatever, the SAX exceptions have to be wrapped
> with Transformer exceptions.  And so it goes... checked exceptions can

Why can't people just agree to use SAXExceptions?! Argh.
I see that the DOM Level 3 stuff is going down the same
road. I would be much happier if they would define their
IDL to be similar to SAX (it's close but not close enough)
and then say that the Java binding of that IDL uses the
SAX exceptions.

> If we change the DTM to use checked exceptions, I have to change about
> 4,000 lines of code in Xalan that used to call the DOM but now calls the
> DTM to now handle the checked exceptions.  This is a fair amount of pain,
> and I'm not sure what it will buy us.

Are you proposing that we would define specific exception
classes that would extend RuntimeException so that we can
throw them within the code without needing to explicitly
state that the method throws that exception? If not, then
I have a problem with this approach.

Using existing code as a reason to not do things right
(depending on some definition of "right", that is) is
not a valid argument in my book. ;)

-- 
Andy Clark * IBM, TRL - Japan * andyc@apache.org

---------------------------------------------------------------------
In case of troubles, e-mail:     webmaster@xml.apache.org
To unsubscribe, e-mail:          general-unsubscribe@xml.apache.org
For additional commands, e-mail: general-help@xml.apache.org