Alex Karasulu wrote:
Why is it bad to have a checked exception in the throws clause of a
constructor?
It's not bad by essence. It just palin hurts when you have to create new
instances in thousands places in the code :
ServerEntry entry = null;
try
{
entry = new DefaultServerEntry( <params> );
}
catch ( WhateverCheckedException wce )
{
LOG.error( "Why the HELL do I have to catch errors when creating a
new object everywhere ???" );
}
instead of :
ServerEntry entry = new DefaultServerentry( <params> ); // I _know_ what
I'm doing !!! params *are* valid, for G*d sake !
IMHO, of course :)
--
cordialement, regards,
Emmanuel Lécharny
www.iktek.com <http://www.iktek.com>
directory.apache.org <http://directory.apache.org>
--
--
cordialement, regards,
Emmanuel Lécharny
www.iktek.com
directory.apache.org