commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gilles Sadowski <gil...@harfang.homelinux.org>
Subject Re: [all][math] Help wanted with exceptions API design
Date Wed, 02 Feb 2011 00:12:54 GMT
On Tue, Feb 01, 2011 at 11:27:26PM +0000, Gary Gregory wrote:
> > -----Original Message-----
> > From: Gilles Sadowski [mailto:gilles@harfang.homelinux.org]
> > Sent: Tuesday, February 01, 2011 18:16
> > To: dev@commons.apache.org
> > Subject: Re: [all][math] Help wanted with exceptions API design
> > 
> > > > > > The currently defined exceptions in [math] can be found in the
> > > > > > top-level package and .exceptions.  Those in the top-level
have at
> > > > > > this point been deprecated.
> > >
> > > Don't package your exceptions in a package called ".exceptions". That is
> > very odd.
> > 
> > Why?
> > 
> > > The exception should be defined where they are used.
> > 
> > What do you do for exceptions that are used in several classes and several
> > packages?
> 
> Here is a probably too simple example: 
> 
> com.example defines IOException
> com.example.input uses IOException
> com.example.output uses IOException

Well, I don't see that as obviously better than storing all exceptions in an
"exception" package. I find the latter tidier.

The problems arises when one thinks that some exception is only needed in
one package:
  com.example.foo uses and defines FooException
Then one discovers
  com.example.bar also uses FooException

Add a few more exceptions and soon people are searching the exceptions
definitions all over the place, or create new ones that duplicate
functionality that already exists in some other package.


Regards,
Gilles

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Mime
View raw message