Take the tour ×  I'm developing an app that will be used to open
and close valves in an industrial environment, and was thinking
of something simple like this:-  public static void
ValveController     public static void OpenValve(string
valveName)         // Implementation to open the valve
public static void CloseValve(string valveName)         //
Implementation to close the valve  (The implementation would
write a few bytes of data to the serial port to control the
valve - an "address" derived from the valve name, and either a
"1" or "0" to open or close the valve).  Another dev asked
whether we should instead create a separate class for each
physical valve, of which there are dozens. I agree it would be
nicer to write code like PlasmaValve.Open() rather than
ValveController.OpenValve("plasma"), but is this overkill?
Also, I was wondering how best to tackle the design with a
couple of hypothetical future requirements in mind:-    1. We
are asked to support a new type of valve requiring different
value