Murder In Tha First

Posted by gotascii

Today I killed an inheritance tree. I took some advice that Dave Thomas told me and broke free of my inheritance chains. If you have inheritance trees in your application with a root class named something along the lines of "Base" you now have a target to point your gun at. If instances of that base are never created directly and the class is just serving as a place to store your shared code, murder remorselessly. Chances are whatever inherits from that base isn't a base and violates the "is-a" inheritance principal. Move the base code into a module and include or extend where appropriate. Your code will gain more flexibility and raw power if you bite the bullet and put a base class in the ground.