Your SMNPDevice is holding down two jobs i.e. being a base class and being a factory (a factory decides what type of objects to create). A cleaner design would be to just let SMNPDevice be a base class, and introduce a separate factory (essentially what Corion's example does).
|
|---|