struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chris Pratt" <thechrispr...@gmail.com>
Subject Re: StrutsStatics...
Date Thu, 21 Feb 2008 16:48:49 GMT
On Thu, Feb 21, 2008 at 7:34 AM, CleverSwine <cleverswine@fastmail.fm>
wrote:

>
>
> Chris Pratt wrote:
> >
> > I don't know for sure, but that's pretty common practice before Java 5's
> > import static.
> >
>
> I disagree. This was in practice in the '90s, although to say it was
> "common" is a stretch. Much more common has always been to define
> constants
> in a utility class or within the class that most used the constant.
>
>
I never said it was a good idea, it's just something that was so common that
they decided to make it part of the language.  I have never used the
anti-pattern myself, I like to create constants in the classes that they
should live (using the Type-safe Enumerations pattern pre-1.5 and Java
Enumerations post-1.5 whenever appropriate).  But it is something I've need
innumerable times, especially when reviewing Apache Java source.
  (*Chris*)

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message