D
Daniel Pitts
I tend to do this too. If there is behavior the should be executedYou 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.