commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gary Gregory <GGreg...@seagullsoftware.com>
Subject RE: [all][math] Help wanted with exceptions API design
Date Wed, 02 Feb 2011 13:25:20 GMT
> -----Original Message-----
> From: jodastephen@gmail.com [mailto:jodastephen@gmail.com] On Behalf Of
> Stephen Colebourne
> Sent: Wednesday, February 02, 2011 03:57
> To: Commons Developers List
> Subject: Re: [all][math] Help wanted with exceptions API design
> 
> On 2 February 2011 00:12, Gilles Sadowski <gilles@harfang.homelinux.org>
> wrote:
> >> 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.
> 
> I too would consider an exceptions package bad practice. Exceptions
> should be located in the highest level package that they might be used
> from. "tidiness" is generally a bad metric for organising package
> structure.

+1!

Gary

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


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


Mime
View raw message