Re: Interface with implied Constructor
On 7/21/2013 3:18 PM, Arved Sandstrom wrote:
On 07/20/2013 04:12 PM, Martin Gregorie wrote:
[ SNIP ]
This is a result of my dislike of using Exceptions to signal anything
except a fatal error and may well be a hangover from writing a lot of C
in the past.
You probably know this, in fact I'm sure you do, but in OOP exceptions
are like 95% of the time used for everything but fatal errors. Well,
maybe 98 or 99 percent of the time.
(Eighty-seven point three percent of cited statistics are
plucked out of thin air. ;-)
One problem is that "fatal" is ill-defined. Is an NPE
"fatal?" Quite often it is, but sometimes the application
is prepared to cope with it -- For example, think of some
code throwing NPE while being managed by an IDE's debugger,
of think of a servlet throwing NPE without taking down the
entire Web container.
Somewhere toward the other end of the spectrum, is a
NumberFormatException "benign?" Maybe, if the application
can protest and prompt for another number. Or maybe not,
if the string came from a configuration file and there's
nobody to respond to a prompt.
The "seriousness" of an exception is not a function of
the exception itself, but of the code that catches (or fails
to catch) it.
--
Eric Sosman
esosman@comcast-dot-net.invalid