Singly-rooted hierarchy

Singly-rooted hierarchy

The singly-rooted hierarchy, in object-oriented programming, is a characteristic of most (but not all) OOP-based programming languages. In most such languages, in fact, all classes inherit directly or indirectly from a single root, usually with a name similar to Object; all classes then form a common inheritance hierarchy.

This idea was introduced first by Smalltalk, the first OOP language, and was since used in most other ones (notably Java and C#).

This feature is especially useful for container libraries - since you want to be able to put anything in a container, it is enough to allow putting an Object in it to be done.A notable exception is C++, where (mainly for compatibility with C and efficiency) there is no single object hierarchy. The mentioned container problem, in C++, has been first tackled with Multiple inheritance [Bruce Eckel, Thinking in C++ vol. 2, Ch. 9 "Multiple inheritance": section "Perspective"] , and then instead solved by Bjarne Stroustrup with help of template-based generic programming [ [http://www.codeguru.com/cpp/tic/tic0246.shtml MFC Programmer's SourceBook : Thinking in C ] ] [Bruce Eckel, Thinking in C++ vol. 1, Ch. 16 "Introduction to Templates": section "The template solution"] .


Wikimedia Foundation. 2010.

Игры ⚽ Поможем решить контрольную работу

Look at other dictionaries:

  • Hierarchy (object-oriented programming) — In computer science s object oriented programming, the mapped relationships of sub and superclasses is known as a hierarchy. This can be visualized as an upside down tree (or perhaps a pyramid), the top of which is known as the root. An exception …   Wikipedia

  • List of object-oriented programming terms — Those words found in object oriented programming. Some are related to OOP and some not. A * Abstract class (also called deferred class) * Abstract method * Abstraction (computer science) * Access control * Accessor method * Allocated class *… …   Wikipedia

  • Glossary of botanical terms — Many of the terms used in Wikipedia glossaries (often most) are already defined and explained within Wikipedia itself. However, lists like the following indicate where new articles need to be written and are also useful for looking up and… …   Wikipedia

  • Germany — /jerr meuh nee/, n. a republic in central Europe: after World War II divided into four zones, British, French, U.S., and Soviet, and in 1949 into East Germany and West Germany; East and West Germany were reunited in 1990. 84,068,216; 137,852 sq.… …   Universalium

  • India — /in dee euh/, n. 1. Hindi, Bharat. a republic in S Asia: a union comprising 25 states and 7 union territories; formerly a British colony; gained independence Aug. 15, 1947; became a republic within the Commonwealth of Nations Jan. 26, 1950.… …   Universalium

  • Hinduism — /hin dooh iz euhm/, n. the common religion of India, based upon the religion of the original Aryan settlers as expounded and evolved in the Vedas, the Upanishads, the Bhagavad Gita, etc., having an extremely diversified character with many… …   Universalium

  • Spain — /spayn/, n. a kingdom in SW Europe. Including the Balearic and Canary islands, 39,244,195; 194,988 sq. mi. (505,019 sq. km). Cap.: Madrid. Spanish, España. * * * Spain Introduction Spain Background: Spain s powerful world empire of the 16th and… …   Universalium

  • Cladistics — For the scientific journal, see Cladistics (journal). Part of a series on Evolutionary Biology …   Wikipedia

  • Life Sciences — ▪ 2009 Introduction Zoology       In 2008 several zoological studies provided new insights into how species life history traits (such as the timing of reproduction or the length of life of adult individuals) are derived in part as responses to… …   Universalium

  • List of terms relating to algorithms and data structures — The [http://www.nist.gov/dads/ NIST Dictionary of Algorithms and Data Structures] is a reference work maintained by the U.S. National Institute of Standards and Technology. It defines a large number of terms relating to algorithms and data… …   Wikipedia

Share the article and excerpts

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