Implementation inheritance

Implementation inheritance

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' pardigram, contending that it locks developers into their original design standards. [ [http://www.javaworld.com/javaworld/jw-08-2003/jw-0801-toolbox.html Why extends is evil - Java World ] ]

References


Wikimedia Foundation. 2010.

Игры ⚽ Нужна курсовая?

Look at other dictionaries:

  • Inheritance (computer science) — In object oriented programming, inheritance is a way to form new classes (instances of which are called objects) using classes that have already been defined. The inheritance concept was invented in 1967 for Simula. [ [http://heim.ifi.uio.no/… …   Wikipedia

  • Inheritance (object-oriented programming) — In object oriented programming (OOP), inheritance is a way to reuse code of existing objects, establish a subtype from an existing object, or both, depending upon programming language support. In classical inheritance where objects are defined by …   Wikipedia

  • Multiple inheritance — is a feature of some object oriented computer programming languages in which a class can inherit behaviors and features from more than one superclass. Languages that support multiple inheritance include: C++, Common Lisp (via CLOS), EuLisp (via… …   Wikipedia

  • Interface inheritance — In object oriented programming, interface inheritance is type of inheritance wherein one or more classes share a set of messages. This sharing can be realized by agreement, as in Python, or by use of programming language specific machinery, as in …   Wikipedia

  • Composition over inheritance — in object oriented programming is a technique by which classes may achieve polymorphic behavior and code reuse by containing other classes which implement the desired functionality instead of through inheritance.[1] This technique is also… …   Wikipedia

  • Lazy Inheritance — is a design pattern used in JavaScript computer programming.It designates a postponed linking of an object with its prototype (class) until it is needed. If used properly, such approach may increase efficiency, simplicity and flexibility of OOP… …   Wikipedia

  • Information hiding — This article is about the computer programming concept. For the practice of hiding data in a message or file, see Steganography. For data encryption, see Obfuscated code. In computer science, information hiding is the principle of segregation of… …   Wikipedia

  • Open/closed principle — In object oriented programming, the open/closed principle states software entities (classes, modules, functions, etc.) should be open for extension, but closed for modification ;[1] that is, such an entity can allow its behaviour to be modified… …   Wikipedia

  • Interface (computing) — For other uses, see Interface. In the field of computer science, an interface is a tool and concept that refers to a point of interaction between components, and is applicable at the level of both hardware and software. This allows a component,… …   Wikipedia

  • Method overriding — Method overriding, in object oriented programming, is a language feature that allows a subclass or child class to provide a specific implementation of a method that is already provided by one of its superclasses or parent classes. The… …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”