struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Al Sutton" <al.sut...@alsutton.com>
Subject Re: StrutsStatics...
Date Thu, 21 Feb 2008 07:01:19 GMT
Personally I prefer using something like;

StrutsConstants.STRUTS_URL........

I know it's not hip and funky, but it shows very clearly to anyone editing
the code where the constant is defined.

The Constant Interface Antipattern or static imports reduce the amount of
typing you have to do, but imho it reduces code clarity.

Al.

----- Original Message ----- 
From: "Dave Newton" <newton.dave@yahoo.com>
To: "Struts Developers List" <dev@struts.apache.org>
Sent: Wednesday, February 20, 2008 8:01 PM
Subject: Re: StrutsStatics...


> --- Antonio Petrelli <antonio.petrelli@gmail.com> wrote:
>> 2008/2/20, Dave Newton <newton.dave@yahoo.com>:
>> > ...why *do* we have StrutsStatics as an interface implemented all over?
>>
>> IMHO all those "constants" should be scattered to all the needing
>> classes, not centralized.
>> In my past projects, I often had this sort of "statics", but I always
>> found a way to put them as private constants in appropriate classes
>> (even "utility" classes).
>
> Well, these are all names under which objects are stored in contexts; they
> may actually all belong together, but they definitely belong in a utility
> class.
>
>> Just my 2 eurocents.
>
> With the US economy the way it is that's probably like a nickel now.
>
> Dave
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> For additional commands, e-mail: dev-help@struts.apache.org
> 


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


Mime
View raw message