commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <craig...@apache.org>
Subject Re: import * vs explicit debate
Date Thu, 03 Apr 2003 03:13:10 GMT


On Wed, 2 Apr 2003, Alex Chaffee / Purple Technology wrote:

> Date: Wed, 2 Apr 2003 16:45:27 -0800
> From: Alex Chaffee / Purple Technology <guru@stinky.com>
> Reply-To: Jakarta Commons Developers List <commons-dev@jakarta.apache.org>,
>      alex@jguru.com
> To: Jakarta Commons Developers List <commons-dev@jakarta.apache.org>
> Subject: Re: import * vs explicit debate
>
> On Wed, Apr 02, 2003 at 06:52:26PM -0500, __matthewHawthorne wrote:
> >
> > But later on, if the class org.apache.Thing is created, the code will no
> > longer compile, right?
>
> Right.
>
> > Isn't this an untouchable reason for using explicit imports?
>
> No; it's a reason for doing a full clean build and unit test run
> before checking in any changes.
>

That only works for code in your own packages -- not in packages you
depend on from other people (especially those that you use binaries for,
as things like Maven encourage you to do even if the underlying package is
open source).

> This way whoever added org.apache.Thing, or updated the library that
> added it, is responsible for not breaking everyone else's build.
>

In other words, I (as the author of one or more commons components) is
supposed to ask ***every*** user of that component "will adding a new
class Foo in my package cause your build to break?"  Yah, right.

It's not my problem.  It's the problem of the person who used "*" imports.

Craig

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


Mime
View raw message