Tag Info

New answers tagged


I would either use a base class with inherited classes or an interface with concrete implementations in order to distinguish the kind of choice the user can make. Interfaces would make more sense if you needed to perform some kind of operation on the choice, but since that isn't in the scope of your question, here is an example of the former option using a ...


I'm for 2, but with slight modification. I wouldn't use enum. You can just as fine use GetType(). If you were to add enum to the mix, it would duplicate the type information contained within the object. On top of that, I would create an Visitor for the Choice class. This will remove the need for reflection and give UI type-safe way to create textual ...

Top 50 recent answers are included