commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steven Caswell" <ste...@caswell.name>
Subject RE: [lang] Nestable
Date Mon, 18 Nov 2002 21:35:18 GMT
Actually, I'm going to change my mind on this one. I should have thought
about it a little more before I pulled the "send" trigger on my
e-mailer.

The original question was (paraphrasing): why doesn't Nestable extend
Throwable?
Short answer: because Nestable is an interface, and Throwable is a
class.

I think the Nestable interface already does just what is was intended to
do: define the contract for being able to manipulate nested exceptions
and errors (i.e., subclasses of Throwable). And in fact, the
implementations of Nestable (NestableError, NestableException, and
NestableRuntimeException) already extend subclasses of Throwable. Each
of these are usable in place of the Java-provided Throwables. So I don't
think there is a need to change the interface.


Steven Caswell
steven@caswell.name
a.k.a Mungo Knotwise of Michel Delving
"One ring to rule them all, one ring to find them..."


> -----Original Message-----
> From: Henri Yandell [mailto:bayard@generationjava.com] 
> Sent: Monday, November 18, 2002 4:08 PM
> To: Jakarta Commons Developers List
> Subject: Re: [lang] Nestable
> 
> 
> 
> 
> On Mon, 18 Nov 2002, Mike Bowler wrote:
> 
> >   > Sure looks to me like it could extend Throwable.
> >
> > I have always understood that all Throwables were either 
> application 
> > level (subclasses of Exception) or system level (subclasses 
> of Error).  
> > It makes no sense IMO to subclass Throwable directly as you 
> would be 
> > implying that you had a new category of problem that wasn't an 
> > application issue and wasn't a system issue.
> 
> It depends on coder preference. I have played with extending 
> Throwable to have a Notification class. I'm usually against 
> turning off functionalities just because the 
> majority-experience doesn't use it.
> 
> For example, the StringUtils empty constructor argument. Most 
> people make their Utils classes private() by default, but a 
> few people hitting found it very useful to hit that from bean 
> shell/velocity style tools.
> 
> > Application code should not be throwing or catching Errors so IMO 
> > Nestable should be a subclass of Exception.  Because you 
> likely don't 
> > want it to be checked, it would more specifically be a subclass of 
> > RuntimeException.
> 
> I assume things like Oracle throw Errors in their driver or 
> some such. Unsure. Is Error just for JVM or do some low-level 
> API creators also do that.
> 
> While a minority, they would still count as customers of 
> commons lang in my view.
> 
> Hen
> 
> 
> --
> To unsubscribe, e-mail:   
> <mailto:commons-dev-> unsubscribe@jakarta.apache.org>
> For 
> additional commands, 
> e-mail: <mailto:commons-dev-help@jakarta.apache.org>
> 
> 



--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message