If there are not so many options and if they do not programatically
change, I would suggest creating a dedicated subclass for all of them:
– BormParticipantOrganizationType
– BormParticipantSystemType
– BormParticipantPersonType
All subclasses of BormParticipantType.
And then use something like:
1) BormParticipantOrganizationType new
2) BormParticipantOrganizationType instance
3) …or your preferred way of making singletons
The advantages?
– It shows well in the autocompletion.
– The values can have different behavior.
– And probably some more.
The disadvantages?
– Serialization into a simple String (and subsequent deserialization)
does not come for free, though it is easy to create methods for that.
– Longer class names.
– With a lot of different enums, the class count will grow significantly.
Michal
On 23.3.2016 20:31, Peter Uhnák wrote:
BormParticipantRole class selectors "#(#Approves #Undefined #Performs
#Initiates #IsResponsible #Acquires #Cooperates #IsInformed #Consults)"
BormParticipantType class selectors "#(#Organization #System #Person)"
But maybe Color was wrong example because the set can be very large
(although the set of options is also limited if you consider some
standards).