|
|
|
|
|
by WirelessGigabit
1195 days ago
|
|
This is what happens when you are building rules are around an existing system versus the other way around. In another language you have a value of type String which can take any value, might crash, might not, when you give it a color value. And then you have a set of items like you described, which are convertible to String (or are a string, like your enum). In fact, the receiver property probably shouldn't even be String, but typeof Color, which can be constructed through a method/constructor that ensures the String input is a valid format. Because which color is "XXXXXX"? |
|