Skip to Content.
Sympa Menu

xom-interest - Re: OT: Exceptions Re: [XOM-interest] design principles

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: Elliotte Rusty Harold <elharo AT metalab.unc.edu>
  • To: <xom-interest AT lists.ibiblio.org>
  • Subject: Re: OT: Exceptions Re: [XOM-interest] design principles
  • Date: Fri, 20 Sep 2002 18:20:59 -0400

At 6:00 PM -0400 9/20/02, Henri Yandell wrote:


If the JVM could be configured with the new JDK 1.4 Logging to log
RuntimeExceptions and not blow the Thread, then I would agree
wholeheartedly. A service I've inherited recently came apart due to their
being a precondition that input must have length of 15 [as dictated in the
protocol, and in fact the physics of the transmitting objects] and would
IAE if anything else came in.

So of course the radio carrier carrying the transmitting objects message
had to prepend some spurious data and instant RuntimeExceptions at
production.

With this, I'm still not convinced by Bloch and Eckel that I should have a
more explosive system just because of the belief that developers can never
be beaten into not doing empty catch clauses.


Bloch certainly wouldn't say this should be a runtime exception. Eckel, I'm not sure. Since you were feeding external, environmental data into the system, it was not correct to assume that it met the preconditions. This should have been handled by a checked exception.

And of course, you can catch runtime exceptions if you think they're possible. You just don't have to if you're sure they're not.
--

+-----------------------+------------------------+-------------------+
| Elliotte Rusty Harold | elharo AT metalab.unc.edu | Writer/Programmer |
+-----------------------+------------------------+-------------------+
| XML in a Nutshell, 2nd Edition (O'Reilly, 2002) |
| http://www.cafeconleche.org/books/xian2/ |
| http://www.amazon.com/exec/obidos/ISBN%3D0596002920/cafeaulaitA/ |
+----------------------------------+---------------------------------+
| Read Cafe au Lait for Java News: http://www.cafeaulait.org/ |
| Read Cafe con Leche for XML News: http://www.cafeconleche.org/ |
+----------------------------------+---------------------------------+




Archive powered by MHonArc 2.6.24.

Top of Page