posted 23 years ago
I'm also a little worried by some of the assumptions in Junilu's "test case", which seem to overcomplicate the problem a bit:
Junilu writes:
This introduces the need for a Choice class or classes and may tend to either spread the knowledge between several implementation classes, or encode it in a non-intuitive way as in the replies above.
I would much rather write the first test at a "higher" level (closer to the actual user story, such as it is), to allow a more flexible refactoring of the inner details. The user neither knows nor cares about symbolic classes, singletons, typesafe-enums or whatever, so how about something like:
This then suggests (to me at least) a simpler style of directly encoding these results as data, rather than code:
Any comments ?
[This message has been edited by Frank Carver (edited June 19, 2001).]