Suppose in a manufacturing environment, there are certain stock materials available for use in a product. For example, there are only a few different sizes of copper tube, each having a specific thickness and diameter combination. For the purposes of clean and minimal code as well as the ability to control the available options, is an enum
a good fit for this combination of data? I was thinking I could make an enum
with a member for each valid stock item (representing metal, physical measurements, etc.), and then provide extension methods on the enum
to return the mentioned details.
The stocks available for use may change over time, so maybe an enum
is not the best answer. Is there a better way to express the valid combination of related values? I am using c#.