Hi Stephan,

> I would argue that it should be named NotInitializedException:  Properly 
> using a service constructor can never cause this exception.  It is using 
> the to-be-deprecated back door of createInstance/initialize that can 
> cause it.

Agreed.

> Then again, not sure if a dedicated NotInitializedException is really 
> useful, or if a plain RuntimeException (with an appropriate message 
> string) would suffice.  What code would catch and handle 
> NotInitializedException (indicating a programming error)?

Because I like exceptions which state the problem in their name already.
Looking at today's code, too many developers are too lazy to care for
proper error messages (you find way too many "throw IOException()"s and
similar, if you want).
A dedicated exception type can help here. The approach of course doesn't
scale, but in some special cases such as here, I think the extra type is
justified.

Also, exception names can be examined programmatically, exceptions
messages can't.

Ciao
Frank

-- 
- Frank Schönheit, Software Engineer         [EMAIL PROTECTED] -
- Sun Microsystems                      http://www.sun.com/staroffice -
- OpenOffice.org Base                       http://dba.openoffice.org -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to