Skip to Content.
Sympa Menu

xom-interest - Re: [XOM-interest] Call for Votes: new name for ParseException

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: Bill de hÓra <bill AT dehora.net>
  • To: Elliotte Rusty Harold <elharo AT metalab.unc.edu>
  • Cc: xom-interest AT lists.ibiblio.org
  • Subject: Re: [XOM-interest] Call for Votes: new name for ParseException
  • Date: Wed, 23 Jul 2003 21:22:04 +0100

Elliotte Rusty Harold wrote:

So I call for a vote and the write-in candidate wins. I don't know. I may have to use my veto power on this one. XOMParseException feels wrong to me. One reason we have packages is so we don't have to write XOMParseException, XOMDocument, XOMNode, XOMText, etc.

Not really. The reason you have packages is to able to qualify names if neccessary (names never have to clash). If you don't want to qualify the name with its package, then you need some implicit naming scheme in the class (XOM*Exception)


Plus, if there's a XOMParseException, I'd sort of expect to see a generic XOMException superclass that covers all the exceptions in XOM, but I can't really have that because of the distinction between checked and runtime exceptions.

If you had a generic exception class or a package level wrapped exception I'd probably just use that and never use any of your others. I deeply dislike APIs that make catch lots of different exceptions (usually to no avail). What am I supposed to do with a typed checked exception? I only ever use exception taxonomies when I have to and to be honest I usually end up bagging the lot with
catch (Exception e){}.


For the moment I'm leaning toward XMLParseException. Then again maybe I shouldn't do anything at all. This is not the only potential conflict. Besides the obvious conflicts with DOM, others include

I've changed my mind (can I do that?). Just throw Exception.

Bill de hÓra






Archive powered by MHonArc 2.6.24.

Top of Page