How to deal with almost the same enums?
- by reza
I need to define enums in several classes. The majority of fields are the same in all of the enums. But one has one or two more fields, another has fewer fields. Now I wonder what is the best way to deal with this?
Create separate enums
public enum Foo {field1, field2, field5 };
public enum Bar {field1, field2, field3, field4 };
or use a general enum for them all
public enum FooBar {field1, field2, field3, field4 , field5};
The enumerations contain the list of actions available for each class.