Skip to main content
1 of 2
Simon B
  • 9.7k
  • 4
  • 29
  • 34

The usual solution is the one you have abandoned, which is generally summarized as "prefer containment over inheritance".

Create a simple class, which has a container to hold the special values. That container could be a dictionary/map, which is effectively a collection of name+value pairs. If you use the right container, querying it can be reasonably fast.

Simon B
  • 9.7k
  • 4
  • 29
  • 34