commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Arun Thomas" <>
Subject RE: [io][vote] FileUtils: decision on style
Date Tue, 29 Jul 2003 18:06:21 GMT
Can someone expound on this "lesson"?  The Developers Guide mentions neither the rule that
"final" should be avoided, nor the rule that a public constructor is required.  I'd love to
know the reasoning - is there some reason that actually derives from the constraints of lang,
or is it due to constraints on how other systems use lang?  I'm particularly confounded by
why the use of final would be a problem.  


-----Original Message-----
From: Henri Yandell [] 
Sent: Tuesday, July 29, 2003 5:55 AM
To: Jakarta Commons Developers List
Subject: Re: [io][vote] FileUtils: decision on style

On Tue, 29 Jul 2003 wrote:

> Hey thanks for the heads up!
> being one of the original authors/contributor of this class, I do have 
> some comments (mostly in favour of your proposal)...
> 1rst: you seem to have added a private constructor to prevent 
> instantiation, which hurts usage as in velocity, where you need an 
> instance of a class to allow the introspection to work. I'm -1 for 
> that change in CVS.

Yep. This is a Lang-lesson. Have an empty constructor in every 'Utils' class which mentions
in a javadoc that this is not intended to be used:

     * <p><code>ObjectUtils</code> instances should NOT be constructed in
     * standard programming. Instead, the class should be used as
     * <code>ObjectUtils.defaultIfNull("a","b");</code>.</p>
     * <p>This constructor is public to permit tools that require a JavaBean instance
     * to operate.</p>

Also worth looking at and maybe adopting the relatively simple: DEVELOPERS-GUIDE.html in Lang.
Mainly it just outlines the XxxUtils philosophy.

Also don't make XxxUtils a final class.


To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message