Re: masks and enums
- From: Daniel Pitts <googlegroupie@xxxxxxxxxxxxx>
- Date: Tue, 31 Jul 2007 15:09:41 -0000
On Jul 31, 4:50 am, Roedy Green <see_webs...@xxxxxxxxxxxxxxxxxxxx>
wrote:
On Mon, 30 Jul 2007 21:23:35 -0400, Lew <l...@xxxxxxxxxxxxxxxx> wrote,I tend to do this too. If there is behavior the should be executed
quoted or indirectly quoted someone who said :
Right, good point. But the question still stands as to why they must be
nested, or when it might be better.
You might nest them if they are used by only the enclosing class. I
find though the enums tend to be popular and reused elsewhere, so I
tend to put them in a separate public or default class in their own
file.
Also too, I tend now to put more and more logic in the enums, and less
in the classes that use them. It makes sense then to give them their
own file to grow in.
based on the enum value, I add it to the enum itself, and then just
call myEnumValue.foo(); :-)
Who'd have thought that enums and polymorphism could be mixed. As
well as being singletons.
But the main reason is I can find them more easily then they are in
their own file.
--
Roedy Green Canadian Mind Products
The Java Glossaryhttp://mindprod.com
.
- References:
- masks and enums
- From: Wojtek
- Re: masks and enums
- From: Roedy Green
- Re: masks and enums
- From: Wojtek
- Re: masks and enums
- From: Roedy Green
- Re: masks and enums
- From: Wojtek
- Re: masks and enums
- From: Roedy Green
- Re: masks and enums
- From: Steve Wampler
- Re: masks and enums
- From: Lew
- Re: masks and enums
- From: Wojtek
- Re: masks and enums
- From: Daniel Pitts
- Re: masks and enums
- From: Lew
- Re: masks and enums
- From: Roedy Green
- masks and enums
- Prev by Date: Re: IllegalAccessError with axis and wsse
- Next by Date: Problem with MAX function in Hibernate
- Previous by thread: Re: masks and enums
- Next by thread: Re: masks and enums
- Index(es):