On Thu, Feb 21, 2008 at 7:34 AM, CleverSwine <[EMAIL PROTECTED]>
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*)

Reply via email to