You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Henri Yandell <ba...@generationjava.com> on 2002/11/18 06:56:02 UTC

[lang] Nestable

Why doesn't Nestable extend Throwable by the way?

Hen


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [lang] Nestable

Posted by Jeff Varszegi <jv...@yahoo.com>.
>  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.

Excellent.  I agree completely.

> Application code should not be throwing or catching Errors

Not necessarily true, but I get your point.

> 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 agree with almost everything you've said.  I'm just wondering now if we shouldn't have
CheckedNestableException and UncheckedNestableException or something like that, where both
implement a Nestable interface.

Jeff

__________________________________________________
Do you Yahoo!?
Yahoo! Web Hosting - Let the expert host your site
http://webhosting.yahoo.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [lang] Nestable

Posted by "Sean C. Sullivan" <se...@seansullivan.com>.
Nestable is an interface.  Let's keep it that way.



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: [lang] Nestable

Posted by Steven Caswell <st...@caswell.name>.
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: <ma...@jakarta.apache.org>
> 
> 



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [lang] Nestable

Posted by Henri Yandell <ba...@generationjava.com>.

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:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [lang] Nestable

Posted by Mike Bowler <mb...@GargoyleSoftware.com>.
  > 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.

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.

-- 
Mike Bowler
Principal, Gargoyle Software Inc.
Voice: (416) 822-0973 | Email  : mbowler@GargoyleSoftware.com
Fax  : (416) 822-0975 | Website: http://www.GargoyleSoftware.com




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: [lang] Nestable

Posted by Steven Caswell <st...@caswell.name>.
Sure looks to me like it could extend Throwable. I've finally gotten a
few minutes to make the serialization change, and I'll add this to the
list unless I see an objection in the next few hours.


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: Jeff Varszegi [mailto:jvarszegi@yahoo.com] 
> Sent: Monday, November 18, 2002 1:08 AM
> To: Jakarta Commons Developers List
> Subject: Re: [lang] Nestable
> 
> 
> FWIW, I think it should.  Looks like it's only meant for use 
> by Throwable classes, and it would shorten the implements 
> clause in implementing classes.  -Jeff
> 
> --- Henri Yandell <ba...@generationjava.com> wrote:
> > 
> > Why doesn't Nestable extend Throwable by the way?
> > 
> > Hen
> > 
> > 
> > --
> > To unsubscribe, e-mail:   
> <mailto:commons-dev-> unsubscribe@jakarta.apache.org>
> > For 
> additional commands, 
> e-mail: 
> > <ma...@jakarta.apache.org>
> > 
> 
> 
> __________________________________________________
> Do you Yahoo!?
> Yahoo! Web Hosting - Let the expert host your site 
http://webhosting.yahoo.com

--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [lang] Nestable

Posted by Jeff Varszegi <jv...@yahoo.com>.
FWIW, I think it should.  Looks like it's only meant for use by Throwable classes, and it would
shorten the implements clause in implementing classes.  -Jeff

--- Henri Yandell <ba...@generationjava.com> wrote:
> 
> Why doesn't Nestable extend Throwable by the way?
> 
> Hen
> 
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
> 


__________________________________________________
Do you Yahoo!?
Yahoo! Web Hosting - Let the expert host your site
http://webhosting.yahoo.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>