commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stephen Colebourne" <scolebou...@btopenworld.com>
Subject Re: [VOTE] (re-vote) XxxUtils constructors
Date Wed, 21 Aug 2002 22:50:34 GMT

----- Original Message -----
From: "Daniel Rall" <dlr@finemaltcoding.com>
> Why SHOULDN'T it be extendable?  I've seen a lot of remarks go by
> about how Terrible Things will happen if a utility class is given an
> accessible, no-op ctor.  I just don't buy it.  On one hand, the
> visible ctor (which does _nothing_) just isn't capable of causing the
> type of damage the purists and language lawyers are spouting about.
> On the other hand, there are valid use cases of supply such a ctor
> which clearly resonate with the Commons charter and the scope of the
> projects in question.
>
>   #################################################################
>   "The focus of the Commons is squarely and solely on developing
>   packages that can be reused by multiple products, both within and
>   without Jakarta."
>                    - http://jakarta.apache.org/commons/charter.html
>   #################################################################
>
> The ability for improved reuse of the components in questions via a
> constructor has been demonstrated lucidly.  It is beyond my
> understanding why there is any sort of issue here at all.

Yes, that is the commons charter. But that does not mean that we should
cowtow to every demand that every other product or project in the world
makes of us. If we do that then every method will be public, every weird and
wacky piece of functionality added. You are interpreting the charter for
your needs.

 Like it or not, tools like Velocity that wish to instantiate utility
classes are misusing the classes. StringUtils is NOT a bean. Thats not its
design. Thats not its role. Thats not its intent. You are arguing that it
will cause no harm to instantiate it. So what, its still a MISUSE.

Its really no different to validating parameter values passed into a method
to ensure the method is used correctly. The private constructor is there to
ensure that the utility class is used correctly.


It seems like a perfectly good compromise (public final) is being spurned.
IMHO the longer the argument goes on, the more likely the code will stay as
it is currently coded - private.

Stephen



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


Mime
View raw message