Inheritance Relation

From GM-RKB
Jump to navigation Jump to search

An Inheritance Relation is a subsumption relation where the property of the higher-level concept are also present in the lower-level concept.



References

2018a

  • (Wikipedia, 2018) ⇒ https://en.wikipedia.org/wiki/Inheritance_(object-oriented_programming) Retrieved:2018-6-24.
    • In object-oriented programming, inheritance is the mechanism of basing an object or class upon another object (prototypal inheritance) or class (class-based inheritance), retaining the same implementation. In most class-based object-oriented languages, an object created through inheritance (a "child object") acquires all the properties and behaviors of the parent object. Inheritance allows programmers to create classes that are built upon existing classes, [1] to specify a new implementation while maintaining the same behaviors (realizing an interface), to reuse code and to independently extend original software via public classes and interfaces. The relationships of objects or classes through inheritance give rise to a directed graph. An inherited class is called a subclass of its parent class or super class. The term "inheritance" is loosely used for both class-based and prototype-based programming, but in narrow use the term is reserved for class-based programming (one class inherits from another), with the corresponding technique in prototype-based programming being instead called delegation (one object delegates to another). Inheritance should not be confused with subtyping. In some languages inheritance and subtyping agree,whereas in others they differ; in general, subtyping establishes an is-a relationship, whereas inheritance only reuses implementation and establishes a syntactic relationship, not necessarily a semantic relationship (inheritance does not ensure behavioral subtyping). To distinguish these concepts, subtyping is also known as interface inheritance, whereas inheritance as defined here is known as implementation inheritance or code inheritance.[2] Still, inheritance is a commonly used mechanism for establishing subtype relationships.

      Inheritance is contrasted with object composition, where one object contains another object (or objects of one class contain objects of another class); see composition over inheritance. Composition implements a has-a relationship, in contrast to the is-a relationship of subtyping.

2018b

  • (SQLAlchemy, 2018) ⇒ Mapping Class Inheritance Hierarchies: http://docs.sqlalchemy.org/en/latest/orm/inheritance.html Retrieved:2018-6-24.
    • QUOTE: SQLAlchemy supports three forms of inheritance: single table inheritance, where several types of classes are represented by a single table, concrete table inheritance, where each type of class is represented by independent tables, and joined table inheritance, where the class hierarchy is broken up among dependent tables, each class represented by its own table that only includes those attributes local to that class.

      The most common forms of inheritance are single and joined table, while concrete inheritance presents more configurational challenges.

      When mappers are configured in an inheritance relationship, SQLAlchemy has the ability to load elements polymorphically, meaning that a single query can return objects of multiple types.

1988

  1. https://www.cse.msu.edu/~cse870/Input/SS2002/MiniProject/Sources/DRC.pdf
  2. Mikhajlov, Leonid; Sekerinski, Emil (1998). "A study of the fragile base class problem (PDF). Proc. 12th European Conf. on Object-Oriented Programming (ECOOP). Lecture Notes in Computer Science. 1445. pp. 355–382. doi:10.1007/BFb0054099. ISBN 978-3-540-64737-9.