Teachers Paradise School Supplies Teacher Resources Free Encyclopedia
Teachers Paradise FREE Teaching Resources
Home Arts Crafts Audio Visual Equipment Office Supplies Teacher Resources
Main Page | Edit this page

Inheritance (computer science)

In computer science, inheritance creates an is a relationship between data structures.

Thus the logic proposition "Socrates is a man" states that the Socrates also has the attributes of other men. Currently Java and C++, among others, allow this type of proposition to be stated directly in the respective languages, by using the Java key word extends, or the C++ notation :. This is unlike composition, where the relationship is has a instead of is a, for example, "a car has a motor".

Inheritance can also be used in interfaces to give the appearance of being whatever - for example if we have an such an interface below, these could all have a "makeNoise();" method.

Thus passing any to an Recoder.captureSoundOf(NoiseMaker()); would capture the sound emitted. Thus from the perspective of a recorder, each is a NoiseMaker.

However, there has been no small amount of inconsistency in the usage of the "is-a" link: R. J. Brachman wrote a paper titled "What IS-A is and isn't", wherein 29 different semantics were found in projects whose knowledge representation schemes involved an "is-a" link. Other links include the "has-part" or "has a" link.

In the UML, is a is a relationship symbolized with an arrow; a white arrowhead points to the superclass. The tail of the arrow rests on the subclass.

Sowa's conceptual graph places the is a in a bubble (circle). The classes [Socrates] and [Man] are placed in rectangles.

Some computer scientists, such as the principal designer of CLU, Barbara Liskov, urge that the use of inheritance be restricted to those designs which truly reflect the problem being solved, and that re-use and subtype polymorphism are not actually the strong points of a design resting solely on inheritance.

The most widely encountered practical application of inheritance is in word processors, where people often don't realize except intuitively that the components of the document are inheriting layout and style properties from their parent elements, not even when they are using style sheets for formatting. A similar impression can be seen with drawing programs.

Usage in different fields

References:



Pay for Educational Supplies & Teaching Supplies with Visa, Master Card, American Express, Discover or Paypal.
TeachersParadise.com HOME | Safe Shopping Guarantee | Help Desk
All trademarks & brands are the property of their respective owners.
Legal Notice 2000-2008 TeachersParadise.com, Inc. All Rights Reserved