Home > Articles > Programming > C/C++

  • Print
  • + Share This
Like this article? We recommend

Like this article? We recommend

Leveraging Base Class Generality

The invoice and contract classes differ only in the way they use the supplied number value. The semantics related to this number are significantly different for these two classes. However, the base class is identical for both of these classes. This is a useful method of reducing derived class code: keep the base class generic and modify the semantics in the derived classes. The base class doesn’t care!

  • + Share This
  • 🔖 Save To Your Account