commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Geir Magnusson Jr." <ge...@adeptra.com>
Subject Re: [VOTE] (re-vote) XxxUtils constructors
Date Thu, 22 Aug 2002 13:18:13 GMT
On 8/21/02 6:50 PM, "Stephen Colebourne" <scolebourne@btopenworld.com>
wrote:

> 
> ----- 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.

What cowtowing are you doing here?  This is code that came from
Turbine/Velocity, didn't it?  Lots of the utils were brought here so more
people could share and participate in it, and aside from this weird
aberration, it's been a resounding success.

What's so wacky about a public CTOR for classes that are used like beans?

> 
> Like it or not, tools like Velocity that wish to instantiate utility
> classes are misusing the classes.

Not at all.  

> 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.

If I remember, stringutils was DESIGNED as a bean, with the INTENT of using
it the same way that we are suggesting it will be used as we suggest.  Tools
that allow this kind of runtime access to public methods go beyond the
normal bean thinking, as they add more than just property access - they add
action/operation on external data as well.


  
> 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.
>

Except that it is being used correctly.  You just don't recognize the use,
which was the original use of the class, as correct.
 
> 
> It seems like a perfectly good compromise (public final) is being spurned.

It's not that good as people will not be able to extend the class in
interesting ways....

> IMHO the longer the argument goes on, the more likely the code will stay as
> it is currently coded - private.
> 

How did that happen?  Shouldn't it remain as it was?  Public?

-- 
Geir Magnusson Jr. 
Research & Development, Adeptra Inc.
geirm@adeptra.com
+1-203-247-1713



--
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