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: StringUtils constructor is private
Date Mon, 12 Aug 2002 22:15:16 GMT


On 12 Aug 2002, Daniel Rall wrote:

> Date: 12 Aug 2002 14:30:59 -0700
> From: Daniel Rall <dlr@finemaltcoding.com>
> Reply-To: Jakarta Commons Developers List <commons-dev@jakarta.apache.org>
> To: Jakarta Commons Developers List <commons-dev@jakarta.apache.org>
> Cc: steven@caswell.name
> Subject: Re: StringUtils constructor is private
>
> "Steven Caswell" <steven@caswell.name> writes:
>
> > I was under the impression that Velocity could not invoke static
> > methods. If this is true, then creating an instance of StringUtils would
> > not do any good. Hence I am -1 on putting in a public constructor since
> > it is generally good practice to prevent construction of an instance of
> > a class that has no member methods.
>
> Velocity will invoke static methods on an instance, just as Java will.
>

But Velocity apparently *requires* an instance in order to do this,
whereas Java doesn't.

Call it a restriction instead of a flaw if you want; it's a requirement
imposed by Velocity on classes whose static methods it wants to access.

Craig



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


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