Possible Duplicate:
How to use Enum with aditional options (All, None)
Somewhat subjective.
I have an enum
public enum Faction {
Aliance,
Horde
}
as we all know code closely modeling business domain it is applied is "always better". In a given domain there are two factions, and these two factions are enumerated in the set above.
Question: What are the arguments for and against including special members such as: None, and All in the enum
above.
Personally I think those two do not belong there, since there is no such faction as All and None. Also using flags-enum is not appropriate.
The workaround is to have another enum, that will model an affiliation with a faction, in that case it is appropriate to have elements such as All and None in there.
Question #2: Should I create FactionAffiliation enum for the sake of righteousness of the model? Or should I spare myself extra typing and view Faction enum as if it is FactionAffiliation?
Edit: Duplicate of http://stackoverflow.com/questions/2228634/how-to-use-enum-with-aditional-options-all-none