Skip to Content.
Sympa Menu

xom-interest - Re: [XOM-interest] CanonicalXMLSerializer exceptions

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: John Cowan <cowan AT mercury.ccil.org>
  • To: Elliotte Harold <elharo AT metalab.unc.edu>
  • Cc: xom-interest <xom-interest AT lists.ibiblio.org>
  • Subject: Re: [XOM-interest] CanonicalXMLSerializer exceptions
  • Date: Sun, 9 Nov 2003 01:32:45 -0500

Elliotte Harold scripsit:

> I have an open question as to whether I should throw an exception if
> someone passes in something else such as "\r". Is it better to silently
> do the right and required thing here? (current behavior) or should I
> warn clients when they attempt to do the wrong thing by throwing an
> IllegalArgumentException?

Throwing the exception is IMHO the most XOMmish behavior; the user is
attempting to do the Wrong Thing and should be stopped. You don't
silently ignore illegal characters in element names, you except.

> On the other hand throwing the exception for
> different values the superclass will accept means I'd be tightening the
> preconditions on the subclass implementation. I think Bertrand Meyer
> (Object Oriented Software Construction) claims I'm not allowed to do that.

IOW, you can't 100% treat a CanonicalXMLSerializer as a Serializer.
Nor can you stuff 10# of *%$@ into a 5# bag. Life is like that.

--
A witness cannot give evidence of his John Cowan
age unless he can remember being born. jcowan AT reutershealth.com
--Judge Blagden http://www.ccil.org/~cowan




Archive powered by MHonArc 2.6.24.

Top of Page