Jump to content

Implementation inheritance

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by 159.153.138.55 (talk) at 22:07, 2 December 2008 (Typo: "pardigram" -> paradigm). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

In programming, Implementation inheritance is the inheritance of the full functionality of a class, as opposed to the inheritance of an interface, which simply defines the methods that must be present. Implementation and Interface inheritance have separate purposes: Implementation Inheritance is designed to reduce redundant code by defining repeatable functions in parent classes - on the other hand interface inheritance does not reduce code, and is used to strictly and abstractly define how to interface (hence the term) with objects in a uniform way.

(Implementation) Inheritance has many advantages and is one of the key principles of Object Oriented Programming. By allowing a parent class to define identical or similar operations for children class, code can be greatly simplified and errors removed. For instance, a Car super class could have a move() method, which defines how cars move. No matter how many subclasses of Car (PickupTruck, Sedan, SUV, etc.) are defined, they will all move the same way, and keeping this method in one place greatly reduces the amount of maintenance needed.

Some have criticized the 'extends' paradigm, contending that it locks developers into their original design standards.[1]

References