in reply to RE: RE (tilly) 1: Object Heirarchy / Design
in thread Object Heirarchy / Design

Why would Obj::Input bother inheriting from Obj? What does either Obj or Obj::Input get from this?

Think about your classic diagrams with Dog and Cat inheriting from Animal. Well Animals generally contain four instances of Leg, that doesn't mean that a Leg is an Animal though!

Instead Obj::Input exists for the purpose of containing useful utility methods for drivers to use. Your Obj class just assumes the interface it needs will work.

As for logging (if you want it), provide a logging method in your base class, then you do just call the method.

  • Comment on RE (tilly) 3: Object Heirarchy / Design