[2389] in java-interest

home help back first fref pref prev next nref lref last post

Re: throws declataration in Java/beta

daemon@ATHENA.MIT.EDU (Gary Aitken)
Sat Sep 30 07:18:15 1995

Date: Thu, 28 Sep 1995 13:17:59 -0700
From: garya@village.org (Gary Aitken)
To: flar@bendenweyr@sun.com (Jim Graham), garya@village.org
Cc: java-interest@java@sun.com
In-Reply-To: <9509281853.AA11495@bendenweyr.Eng.Sun.COM>

>Only forseen exceptions are generally required to be declared (and
>therefore need to be caught or explicitly passed on).  Exceptions which
>are subclasses of RuntimeException or Error - which are not generally
>part of the API of a given method - don't have to be declared.
>Exceptions such as IOException, which are part of the natural working
>domain of many methods, must be declared where they can occur so that
>callers of that method are aware that the indicated exception is a
>possible result of calling the method.

It seems to me that this reasoning has a flaw.
It assumes that the base class designer can forsee all possible algorithms
needed by all possible subclasses, and include the necessary exception
declarations to cover them.  Unfortunately, it can't, which is why the
whole problem arises.  No base class can forsee anything about the
mechanisms needed by a subclass to implement a different but functionally
equivalent or complementary, task.

Gary Aitken		garya@village.org
-
Note to Sun employees: this is an EXTERNAL mailing list!
Info: send 'help' to java-interest-request@java.sun.com

home help back first fref pref prev next nref lref last post