https://en.wikipedia.org/w/index.php?action=history&feed=atom&title=Inheritance_%28object-oriented_programming%29 Inheritance (object-oriented programming) - Revision history 2025-05-29T20:03:21Z Revision history for this page on the wiki MediaWiki 1.45.0-wmf.3 https://en.wikipedia.org/w/index.php?title=Inheritance_(object-oriented_programming)&diff=1290676012&oldid=prev Polyphemus Goode: hatnote 2025-05-16T09:34:36Z <p>hatnote</p> <table style="background-color: #fff; color: #202122;" data-mw="interface"> <col class="diff-marker" /> <col class="diff-content" /> <col class="diff-marker" /> <col class="diff-content" /> <tr class="diff-title" lang="en"> <td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Previous revision</td> <td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 09:34, 16 May 2025</td> </tr><tr> <td colspan="2" class="diff-lineno">Line 1:</td> <td colspan="2" class="diff-lineno">Line 1:</td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>{{Short description|Process of deriving classes from, and organizing them into, a hierarchy}}</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>{{Short description|Process of deriving classes from, and organizing them into, a hierarchy}}</div></td> </tr> <tr> <td colspan="2" class="diff-empty diff-side-deleted"></td> <td class="diff-marker" data-marker="+"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>{{redirect|Classical inheritance|later inheritance of ancient culture|classical tradition}}</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>{{cleanup|reason=Cluttered|date=April 2015}}</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>{{cleanup|reason=Cluttered|date=April 2015}}</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>In [[object-oriented programming]], '''inheritance''' is the mechanism of basing an [[Object (computer science)|object]] or [[Class (computer programming)|class]] upon another object ([[Prototype-based programming|prototype-based inheritance]]) or class ([[Class-based programming|class-based inheritance]]), retaining similar [[implementation]]. Also defined as deriving new classes ([[#Subclasses and superclasses|sub classes]]) from existing ones such as super class or [[Fragile base class|base class]] and then forming them into a hierarchy of classes. In most class-based object-oriented languages like [[C++]], an object created through inheritance, a "child object", acquires all the properties and behaviors of the "parent object", with the exception of: [[Constructor (object-oriented programming)|constructors]], destructors, [[operator overloading|overloaded operators]] and [[friend function]]s of the base class. Inheritance allows programmers to create classes that are built upon existing classes,&lt;ref&gt;{{cite web|url=https://www.cse.msu.edu/~cse870/Input/SS2002/MiniProject/Sources/DRC.pdf |title=Designing Reusable Classes |last=Johnson |first=Ralph |date=August 26, 1991 |website=www.cse.msu.edu }}&lt;/ref&gt; to specify a new implementation while maintaining the same behaviors ([[Class diagram#Realization/Implementation|realizing an interface]]), to reuse code and to independently extend original software via public classes and [[interface (object-oriented programming)|interface]]s. The relationships of objects or classes through inheritance give rise to a [[directed acyclic graph]].</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>In [[object-oriented programming]], '''inheritance''' is the mechanism of basing an [[Object (computer science)|object]] or [[Class (computer programming)|class]] upon another object ([[Prototype-based programming|prototype-based inheritance]]) or class ([[Class-based programming|class-based inheritance]]), retaining similar [[implementation]]. Also defined as deriving new classes ([[#Subclasses and superclasses|sub classes]]) from existing ones such as super class or [[Fragile base class|base class]] and then forming them into a hierarchy of classes. In most class-based object-oriented languages like [[C++]], an object created through inheritance, a "child object", acquires all the properties and behaviors of the "parent object", with the exception of: [[Constructor (object-oriented programming)|constructors]], destructors, [[operator overloading|overloaded operators]] and [[friend function]]s of the base class. Inheritance allows programmers to create classes that are built upon existing classes,&lt;ref&gt;{{cite web|url=https://www.cse.msu.edu/~cse870/Input/SS2002/MiniProject/Sources/DRC.pdf |title=Designing Reusable Classes |last=Johnson |first=Ralph |date=August 26, 1991 |website=www.cse.msu.edu }}&lt;/ref&gt; to specify a new implementation while maintaining the same behaviors ([[Class diagram#Realization/Implementation|realizing an interface]]), to reuse code and to independently extend original software via public classes and [[interface (object-oriented programming)|interface]]s. The relationships of objects or classes through inheritance give rise to a [[directed acyclic graph]].</div></td> </tr> </table> Polyphemus Goode https://en.wikipedia.org/w/index.php?title=Inheritance_(object-oriented_programming)&diff=1283768252&oldid=prev 65.206.123.158: /* Issues and alternatives */ small copy edit 2025-04-03T15:15:38Z <p><span class="autocomment">Issues and alternatives: </span> small copy edit</p> <table style="background-color: #fff; color: #202122;" data-mw="interface"> <col class="diff-marker" /> <col class="diff-content" /> <col class="diff-marker" /> <col class="diff-content" /> <tr class="diff-title" lang="en"> <td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Previous revision</td> <td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 15:15, 3 April 2025</td> </tr><tr> <td colspan="2" class="diff-lineno">Line 199:</td> <td colspan="2" class="diff-lineno">Line 199:</td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>==Issues and alternatives==</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>==Issues and alternatives==</div></td> </tr> <tr> <td class="diff-marker" data-marker="−"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>Implementation inheritance <del style="font-weight: bold; text-decoration: none;">is</del> controversial among programmers and theoreticians of object-oriented programming since at least the 1990s. Among <del style="font-weight: bold; text-decoration: none;">them</del> are the authors of ''[[Design Patterns]]'', who advocate interface inheritance<del style="font-weight: bold; text-decoration: none;"> instead</del>, and favor [[Composition over inheritance|composition over inheritance]]. For example, the decorator pattern (as mentioned [[#Design constraints|above]]) has been proposed to overcome the static nature of inheritance between classes. As a more fundamental solution to the same problem, [[role-oriented programming]] introduces a distinct relationship, ''played-by'', combining properties of inheritance and composition into a new concept.{{citation needed|date=February 2016}}</div></td> <td class="diff-marker" data-marker="+"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>Implementation inheritance <ins style="font-weight: bold; text-decoration: none;">has been</ins> controversial among programmers and theoreticians of object-oriented programming since at least the 1990s. Among <ins style="font-weight: bold; text-decoration: none;">the critics</ins> are the authors of ''[[Design Patterns]]'', who advocate<ins style="font-weight: bold; text-decoration: none;"> instead for</ins> interface inheritance, and favor [[Composition over inheritance|composition over inheritance]]. For example, the decorator pattern (as mentioned [[#Design constraints|above]]) has been proposed to overcome the static nature of inheritance between classes. As a more fundamental solution to the same problem, [[role-oriented programming]] introduces a distinct relationship, ''played-by'', combining properties of inheritance and composition into a new concept.{{citation needed|date=February 2016}}</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>According to [[Allen Holub]], the main problem with implementation inheritance is that it introduces unnecessary [[Coupling (computer programming)|coupling]] in the form of the [[Fragile base class|"fragile base class problem"]]:{{r|Mikhajlov}} modifications to the base class implementation can cause inadvertent behavioral changes in subclasses. Using interfaces avoids this problem because no implementation is shared, only the API.{{r|holub}} Another way of stating this is that "inheritance breaks [[Encapsulation (object-oriented programming)|encapsulation]]".&lt;ref&gt;{{Cite journal |doi=10.1145/250707.239108 |title=Evolution of object behavior using context relations |journal=ACM SIGSOFT Software Engineering Notes |volume=21 |issue=6 |page=46 |year=1996 |last1=Seiter |first1=Linda M. |last2=Palsberg |first2=Jens |last3=Lieberherr |first3=Karl J. |url=http://www.ccs.neu.edu/research/demeter/papers/context-journal/_context.html |citeseerx=10.1.1.36.5053}}&lt;/ref&gt; The problem surfaces clearly in open object-oriented systems such as [[Software framework|frameworks]], where client code is expected to inherit from system-supplied classes and then substituted for the system's classes in its algorithms.{{r|Mikhajlov}}</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>According to [[Allen Holub]], the main problem with implementation inheritance is that it introduces unnecessary [[Coupling (computer programming)|coupling]] in the form of the [[Fragile base class|"fragile base class problem"]]:{{r|Mikhajlov}} modifications to the base class implementation can cause inadvertent behavioral changes in subclasses. Using interfaces avoids this problem because no implementation is shared, only the API.{{r|holub}} Another way of stating this is that "inheritance breaks [[Encapsulation (object-oriented programming)|encapsulation]]".&lt;ref&gt;{{Cite journal |doi=10.1145/250707.239108 |title=Evolution of object behavior using context relations |journal=ACM SIGSOFT Software Engineering Notes |volume=21 |issue=6 |page=46 |year=1996 |last1=Seiter |first1=Linda M. |last2=Palsberg |first2=Jens |last3=Lieberherr |first3=Karl J. |url=http://www.ccs.neu.edu/research/demeter/papers/context-journal/_context.html |citeseerx=10.1.1.36.5053}}&lt;/ref&gt; The problem surfaces clearly in open object-oriented systems such as [[Software framework|frameworks]], where client code is expected to inherit from system-supplied classes and then substituted for the system's classes in its algorithms.{{r|Mikhajlov}}</div></td> </tr> </table> 65.206.123.158 https://en.wikipedia.org/w/index.php?title=Inheritance_(object-oriented_programming)&diff=1271606136&oldid=prev 83.226.114.15: link to article 2025-01-24T21:09:11Z <p>link to article</p> <table style="background-color: #fff; color: #202122;" data-mw="interface"> <col class="diff-marker" /> <col class="diff-content" /> <col class="diff-marker" /> <col class="diff-content" /> <tr class="diff-title" lang="en"> <td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Previous revision</td> <td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 21:09, 24 January 2025</td> </tr><tr> <td colspan="2" class="diff-lineno">Line 199:</td> <td colspan="2" class="diff-lineno">Line 199:</td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>==Issues and alternatives==</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>==Issues and alternatives==</div></td> </tr> <tr> <td class="diff-marker" data-marker="−"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>Implementation inheritance is controversial among programmers and theoreticians of object-oriented programming since at least the 1990s. Among them are the authors of ''[[Design Patterns]]'', who advocate interface inheritance instead, and favor composition over inheritance. For example, the decorator pattern (as mentioned [[#Design constraints|above]]) has been proposed to overcome the static nature of inheritance between classes. As a more fundamental solution to the same problem, [[role-oriented programming]] introduces a distinct relationship, ''played-by'', combining properties of inheritance and composition into a new concept.{{citation needed|date=February 2016}}</div></td> <td class="diff-marker" data-marker="+"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>Implementation inheritance is controversial among programmers and theoreticians of object-oriented programming since at least the 1990s. Among them are the authors of ''[[Design Patterns]]'', who advocate interface inheritance instead, and favor <ins style="font-weight: bold; text-decoration: none;">[[Composition over inheritance|</ins>composition over inheritance<ins style="font-weight: bold; text-decoration: none;">]]</ins>. For example, the decorator pattern (as mentioned [[#Design constraints|above]]) has been proposed to overcome the static nature of inheritance between classes. As a more fundamental solution to the same problem, [[role-oriented programming]] introduces a distinct relationship, ''played-by'', combining properties of inheritance and composition into a new concept.{{citation needed|date=February 2016}}</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>According to [[Allen Holub]], the main problem with implementation inheritance is that it introduces unnecessary [[Coupling (computer programming)|coupling]] in the form of the [[Fragile base class|"fragile base class problem"]]:{{r|Mikhajlov}} modifications to the base class implementation can cause inadvertent behavioral changes in subclasses. Using interfaces avoids this problem because no implementation is shared, only the API.{{r|holub}} Another way of stating this is that "inheritance breaks [[Encapsulation (object-oriented programming)|encapsulation]]".&lt;ref&gt;{{Cite journal |doi=10.1145/250707.239108 |title=Evolution of object behavior using context relations |journal=ACM SIGSOFT Software Engineering Notes |volume=21 |issue=6 |page=46 |year=1996 |last1=Seiter |first1=Linda M. |last2=Palsberg |first2=Jens |last3=Lieberherr |first3=Karl J. |url=http://www.ccs.neu.edu/research/demeter/papers/context-journal/_context.html |citeseerx=10.1.1.36.5053}}&lt;/ref&gt; The problem surfaces clearly in open object-oriented systems such as [[Software framework|frameworks]], where client code is expected to inherit from system-supplied classes and then substituted for the system's classes in its algorithms.{{r|Mikhajlov}}</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>According to [[Allen Holub]], the main problem with implementation inheritance is that it introduces unnecessary [[Coupling (computer programming)|coupling]] in the form of the [[Fragile base class|"fragile base class problem"]]:{{r|Mikhajlov}} modifications to the base class implementation can cause inadvertent behavioral changes in subclasses. Using interfaces avoids this problem because no implementation is shared, only the API.{{r|holub}} Another way of stating this is that "inheritance breaks [[Encapsulation (object-oriented programming)|encapsulation]]".&lt;ref&gt;{{Cite journal |doi=10.1145/250707.239108 |title=Evolution of object behavior using context relations |journal=ACM SIGSOFT Software Engineering Notes |volume=21 |issue=6 |page=46 |year=1996 |last1=Seiter |first1=Linda M. |last2=Palsberg |first2=Jens |last3=Lieberherr |first3=Karl J. |url=http://www.ccs.neu.edu/research/demeter/papers/context-journal/_context.html |citeseerx=10.1.1.36.5053}}&lt;/ref&gt; The problem surfaces clearly in open object-oriented systems such as [[Software framework|frameworks]], where client code is expected to inherit from system-supplied classes and then substituted for the system's classes in its algorithms.{{r|Mikhajlov}}</div></td> </tr> </table> 83.226.114.15 https://en.wikipedia.org/w/index.php?title=Inheritance_(object-oriented_programming)&diff=1261148990&oldid=prev PaulTanenbaum: (1) Tidied up and (2) added that the inherits-from relation is a strict partial order 2024-12-04T14:49:55Z <p>(1) Tidied up and (2) added that the inherits-from relation is a <a href="/wiki/Strict_partial_order" class="mw-redirect" title="Strict partial order">strict partial order</a></p> <table style="background-color: #fff; color: #202122;" data-mw="interface"> <col class="diff-marker" /> <col class="diff-content" /> <col class="diff-marker" /> <col class="diff-content" /> <tr class="diff-title" lang="en"> <td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Previous revision</td> <td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 14:49, 4 December 2024</td> </tr><tr> <td colspan="2" class="diff-lineno">Line 3:</td> <td colspan="2" class="diff-lineno">Line 3:</td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>In [[object-oriented programming]], '''inheritance''' is the mechanism of basing an [[Object (computer science)|object]] or [[Class (computer programming)|class]] upon another object ([[Prototype-based programming|prototype-based inheritance]]) or class ([[Class-based programming|class-based inheritance]]), retaining similar [[implementation]]. Also defined as deriving new classes ([[#Subclasses and superclasses|sub classes]]) from existing ones such as super class or [[Fragile base class|base class]] and then forming them into a hierarchy of classes. In most class-based object-oriented languages like [[C++]], an object created through inheritance, a "child object", acquires all the properties and behaviors of the "parent object", with the exception of: [[Constructor (object-oriented programming)|constructors]], destructors, [[operator overloading|overloaded operators]] and [[friend function]]s of the base class. Inheritance allows programmers to create classes that are built upon existing classes,&lt;ref&gt;{{cite web|url=https://www.cse.msu.edu/~cse870/Input/SS2002/MiniProject/Sources/DRC.pdf |title=Designing Reusable Classes |last=Johnson |first=Ralph |date=August 26, 1991 |website=www.cse.msu.edu }}&lt;/ref&gt; to specify a new implementation while maintaining the same behaviors ([[Class diagram#Realization/Implementation|realizing an interface]]), to reuse code and to independently extend original software via public classes and [[interface (object-oriented programming)|interface]]s. The relationships of objects or classes through inheritance give rise to a [[directed acyclic graph]].</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>In [[object-oriented programming]], '''inheritance''' is the mechanism of basing an [[Object (computer science)|object]] or [[Class (computer programming)|class]] upon another object ([[Prototype-based programming|prototype-based inheritance]]) or class ([[Class-based programming|class-based inheritance]]), retaining similar [[implementation]]. Also defined as deriving new classes ([[#Subclasses and superclasses|sub classes]]) from existing ones such as super class or [[Fragile base class|base class]] and then forming them into a hierarchy of classes. In most class-based object-oriented languages like [[C++]], an object created through inheritance, a "child object", acquires all the properties and behaviors of the "parent object", with the exception of: [[Constructor (object-oriented programming)|constructors]], destructors, [[operator overloading|overloaded operators]] and [[friend function]]s of the base class. Inheritance allows programmers to create classes that are built upon existing classes,&lt;ref&gt;{{cite web|url=https://www.cse.msu.edu/~cse870/Input/SS2002/MiniProject/Sources/DRC.pdf |title=Designing Reusable Classes |last=Johnson |first=Ralph |date=August 26, 1991 |website=www.cse.msu.edu }}&lt;/ref&gt; to specify a new implementation while maintaining the same behaviors ([[Class diagram#Realization/Implementation|realizing an interface]]), to reuse code and to independently extend original software via public classes and [[interface (object-oriented programming)|interface]]s. The relationships of objects or classes through inheritance give rise to a [[directed acyclic graph]].</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td> </tr> <tr> <td class="diff-marker" data-marker="−"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>An inherited class is called a '''subclass''' of its parent class or super class. The term <del style="font-weight: bold; text-decoration: none;">"</del>inheritance<del style="font-weight: bold; text-decoration: none;">"</del> 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 (object-oriented programming)|delegation]]'' (one object ''delegates to'' another). Class-modifying inheritance patterns can be pre-defined according to simple network interface parameters such that inter-language compatibility is preserved.&lt;ref&gt;{{cite book |last1=Madsen |first1=OL |title=Conference proceedings on Object-oriented programming systems, languages and applications - OOPSLA '89 |chapter=Virtual classes: A powerful mechanism in object-oriented programming |date=1989|pages=397–406 |doi=10.1145/74877.74919 |isbn=0897913337 |s2cid=1104130 }}&lt;/ref&gt;&lt;ref&gt;{{cite book |last1=Davies, Turk |title=Advanced Methods and Deep Learning in Computer Vision |date=2021 |publisher=Elsevier Science |pages=179–342}}&lt;/ref&gt;</div></td> <td class="diff-marker" data-marker="+"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>An inherited class is called a '''subclass''' of its parent class or super class. The term <ins style="font-weight: bold; text-decoration: none;">''</ins>inheritance<ins style="font-weight: bold; text-decoration: none;">''</ins> 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 (object-oriented programming)|delegation]]'' (one object ''delegates to'' another). Class-modifying inheritance patterns can be pre-defined according to simple network interface parameters such that inter-language compatibility is preserved.&lt;ref&gt;{{cite book |last1=Madsen |first1=OL |title=Conference proceedings on Object-oriented programming systems, languages and applications - OOPSLA '89 |chapter=Virtual classes: A powerful mechanism in object-oriented programming |date=1989|pages=397–406 |doi=10.1145/74877.74919 |isbn=0897913337 |s2cid=1104130 }}&lt;/ref&gt;&lt;ref&gt;{{cite book |last1=Davies, Turk |title=Advanced Methods and Deep Learning in Computer Vision |date=2021 |publisher=Elsevier Science |pages=179–342}}&lt;/ref&gt;</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td> </tr> <tr> <td class="diff-marker" data-marker="−"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>Inheritance should not be confused with [[subtyping]].&lt;ref name=Cook90&gt;{{Cite conference |last1=Cook |first1=William R. |last2=Hill |first2=Walter |last3=Canning |first3=Peter S. |doi=10.1145/96709.96721 |title=Inheritance is not subtyping |conference=Proceedings of the 17th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL) |pages=125–135 |year=1990 |isbn=0-89791-343-4 |citeseerx=10.1.1.102.8635}}&lt;/ref&gt;&lt;ref&gt;{{cite tech report |first=Luca |last=Cardelli |title=Typeful Programming |number=SRC Research Report 45 |institution=[[Digital Equipment Corporation]] |year=1993 |page=32–33}}&lt;/ref&gt; In some languages inheritance and subtyping agree,{{efn|This is generally true only in statically-typed class-based OO languages, such as [[C++]], [[C Sharp (programming language)|C#]], Java, and [[Scala (programming language)|Scala]].}} 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 sometimes referred to as ''interface inheritance'' (without acknowledging that the specialization of type variables also induces a subtyping relation), whereas inheritance as defined here is known as ''implementation inheritance'' or ''code inheritance''.&lt;ref name="Mikhajlov"&gt;{{Cite conference |doi=10.1007/BFb0054099 |title=A study of the fragile base class problem |conference=Proceedings of the 12th European Conference on Object-Oriented Programming (ECOOP) |volume=1445 |pages=355–382 |series=Lecture Notes in Computer Science |publisher=Springer |year=1998 |last1=Mikhajlov |first1=Leonid |last2=Sekerinski |first2=Emil |isbn=978-3-540-64737-9 |url=http://extras.springer.com/2000/978-3-540-67660-7/papers/1445/14450355.pdf |access-date=2015-08-28 |archive-date=2017-08-13 |archive-url=https://web.archive.org/web/20170813041125/http://extras.springer.com/2000/978-3-540-67660-7/papers/1445/14450355.pdf |url-status=dead}}&lt;/ref&gt; Still, inheritance is a commonly used mechanism for establishing subtype relationships.&lt;ref&gt;{{cite conference |last1=Tempero |first1=Ewan |first2=Hong Yul |last2=Yang |first3=James |last3=Noble |title=What programmers do with inheritance in Java |conference=ECOOP 2013–Object-Oriented Programming |year= 2013 |pages=577–601 |url=https://www.cs.auckland.ac.nz/~ewan/qualitas/studies/inheritance/TemperoYangNobleECOOP2013-pre.pdf |doi=10.1007/978-3-642-39038-8_24 |isbn=978-3-642-39038-8 |series=Lecture Notes in Computer Science |volume=7920 |publisher=Springer }}&lt;/ref&gt;</div></td> <td class="diff-marker" data-marker="+"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>Inheritance should not be confused with [[subtyping]].&lt;ref name=Cook90&gt;{{Cite conference |last1=Cook |first1=William R. |last2=Hill |first2=Walter |last3=Canning |first3=Peter S. |doi=10.1145/96709.96721 |title=Inheritance is not subtyping |conference=Proceedings of the 17th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL) |pages=125–135 |year=1990 |isbn=0-89791-343-4 |citeseerx=10.1.1.102.8635}}&lt;/ref&gt;&lt;ref&gt;{{cite tech report |first=Luca |last=Cardelli |title=Typeful Programming |number=SRC Research Report 45 |institution=[[Digital Equipment Corporation]] |year=1993 |page=32–33}}&lt;/ref&gt; In some languages inheritance and subtyping agree,{{efn|This is generally true only in statically-typed class-based OO languages, such as [[C++]], [[C Sharp (programming language)|C#]], Java, and [[Scala (programming language)|Scala]].}} whereas in others they differ; in general, subtyping establishes an <ins style="font-weight: bold; text-decoration: none;">''</ins>[[is-a]]<ins style="font-weight: bold; text-decoration: none;">''</ins> 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 sometimes referred to as ''interface inheritance'' (without acknowledging that the specialization of type variables also induces a subtyping relation), whereas inheritance as defined here is known as ''implementation inheritance'' or ''code inheritance''.&lt;ref name="Mikhajlov"&gt;{{Cite conference |doi=10.1007/BFb0054099 |title=A study of the fragile base class problem |conference=Proceedings of the 12th European Conference on Object-Oriented Programming (ECOOP) |volume=1445 |pages=355–382 |series=Lecture Notes in Computer Science |publisher=Springer |year=1998 |last1=Mikhajlov |first1=Leonid |last2=Sekerinski |first2=Emil |isbn=978-3-540-64737-9 |url=http://extras.springer.com/2000/978-3-540-67660-7/papers/1445/14450355.pdf |access-date=2015-08-28 |archive-date=2017-08-13 |archive-url=https://web.archive.org/web/20170813041125/http://extras.springer.com/2000/978-3-540-67660-7/papers/1445/14450355.pdf |url-status=dead}}&lt;/ref&gt; Still, inheritance is a commonly used mechanism for establishing subtype relationships.&lt;ref&gt;{{cite conference |last1=Tempero |first1=Ewan |first2=Hong Yul |last2=Yang |first3=James |last3=Noble |title=What programmers do with inheritance in Java |conference=ECOOP 2013–Object-Oriented Programming |year= 2013 |pages=577–601 |url=https://www.cs.auckland.ac.nz/~ewan/qualitas/studies/inheritance/TemperoYangNobleECOOP2013-pre.pdf |doi=10.1007/978-3-642-39038-8_24 |isbn=978-3-642-39038-8 |series=Lecture Notes in Computer Science |volume=7920 |publisher=Springer }}&lt;/ref&gt;</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td> </tr> <tr> <td class="diff-marker" data-marker="−"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>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]]. <del style="font-weight: bold; text-decoration: none;">Composition</del> <del style="font-weight: bold; text-decoration: none;">implements</del> <del style="font-weight: bold; text-decoration: none;">a</del> <del style="font-weight: bold; text-decoration: none;">[[has</del>-a<del style="font-weight: bold; text-decoration: none;">]]</del> relationship, <del style="font-weight: bold; text-decoration: none;">in</del> <del style="font-weight: bold; text-decoration: none;">contrast</del> <del style="font-weight: bold; text-decoration: none;">to</del> <del style="font-weight: bold; text-decoration: none;">the is</del>-a relationship<del style="font-weight: bold; text-decoration: none;"> of subtyping</del>.</div></td> <td class="diff-marker" data-marker="+"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>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]]. <ins style="font-weight: bold; text-decoration: none;">In</ins> <ins style="font-weight: bold; text-decoration: none;">contrast</ins> <ins style="font-weight: bold; text-decoration: none;">to</ins> <ins style="font-weight: bold; text-decoration: none;">subtyping’s ''is</ins>-a<ins style="font-weight: bold; text-decoration: none;">''</ins> relationship, <ins style="font-weight: bold; text-decoration: none;">composition</ins> <ins style="font-weight: bold; text-decoration: none;">implements</ins> <ins style="font-weight: bold; text-decoration: none;">a</ins> <ins style="font-weight: bold; text-decoration: none;">''[[has</ins>-a<ins style="font-weight: bold; text-decoration: none;">]]''</ins> relationship.</div></td> </tr> <tr> <td colspan="2" class="diff-empty diff-side-deleted"></td> <td class="diff-marker" data-marker="+"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><br /></td> </tr> <tr> <td colspan="2" class="diff-empty diff-side-deleted"></td> <td class="diff-marker" data-marker="+"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>Mathematically speaking, inheritance in any system of classes induces a [[partially ordered set|strict partial order]] on the set of classes in that system.</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>== History ==</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>== History ==</div></td> </tr> </table> PaulTanenbaum https://en.wikipedia.org/w/index.php?title=Inheritance_(object-oriented_programming)&diff=1248635144&oldid=prev Jerryobject: WP:REFerence WP:CITation parameters: respaces, reorders, update-standardize-conform, corrects, adds, fills. Small WP:COPYEDIT WP:EoS WP:TERSE: cut needless word repeat. WP:LINKs: add, update-standardize, needless WP:PIPE > WP:NOPIPE. MOS:COMMENT add. 2024-09-30T16:56:09Z <p><a href="/wiki/Wikipedia:REF" class="mw-redirect" title="Wikipedia:REF">WP:REFerence</a> <a href="/wiki/Wikipedia:CIT" class="mw-redirect" title="Wikipedia:CIT">WP:CITation</a> parameters: respaces, reorders, update-standardize-conform, corrects, adds, fills. Small <a href="/wiki/Wikipedia:COPYEDIT" class="mw-redirect" title="Wikipedia:COPYEDIT">WP:COPYEDIT</a> <a href="/wiki/Wikipedia:EoS" class="mw-redirect" title="Wikipedia:EoS">WP:EoS</a> <a href="/wiki/Wikipedia:TERSE" class="mw-redirect" title="Wikipedia:TERSE">WP:TERSE</a>: cut needless word repeat. <a href="/wiki/Wikipedia:LINK" class="mw-redirect" title="Wikipedia:LINK">WP:LINKs</a>: add, update-standardize, needless <a href="/wiki/Wikipedia:PIPE" class="mw-redirect" title="Wikipedia:PIPE">WP:PIPE</a> &gt; <a href="/wiki/Wikipedia:NOPIPE" class="mw-redirect" title="Wikipedia:NOPIPE">WP:NOPIPE</a>. <a href="/wiki/MOS:COMMENT" class="mw-redirect" title="MOS:COMMENT">MOS:COMMENT</a> add.</p> <a href="//en.wikipedia.org/w/index.php?title=Inheritance_(object-oriented_programming)&amp;diff=1248635144&amp;oldid=1244462754">Show changes</a> Jerryobject https://en.wikipedia.org/w/index.php?title=Inheritance_(object-oriented_programming)&diff=1244462754&oldid=prev InternetArchiveBot: Rescuing 2 sources and tagging 0 as dead.) #IABot (v2.0.9.5 2024-09-07T07:52:04Z <p>Rescuing 2 sources and tagging 0 as dead.) #IABot (v2.0.9.5</p> <table style="background-color: #fff; color: #202122;" data-mw="interface"> <col class="diff-marker" /> <col class="diff-content" /> <col class="diff-marker" /> <col class="diff-content" /> <tr class="diff-title" lang="en"> <td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Previous revision</td> <td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 07:52, 7 September 2024</td> </tr><tr> <td colspan="2" class="diff-lineno">Line 16:</td> <td colspan="2" class="diff-lineno">Line 16:</td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>[[File:Single Inheritance.jpg|thumb|upright|Single inheritance]]</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>[[File:Single Inheritance.jpg|thumb|upright|Single inheritance]]</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>[[File:Multiple Inheritance.jpg|thumb|upright|Multiple inheritance]]</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>[[File:Multiple Inheritance.jpg|thumb|upright|Multiple inheritance]]</div></td> </tr> <tr> <td class="diff-marker" data-marker="−"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>There are various types of inheritance, based on paradigm and specific language.&lt;ref&gt;{{cite web|url=https://www.cs.nmsu.edu/~rth/cs/cs177/map/inheritd.html|title=C++ Inheritance|website=www.cs.nmsu.edu}}&lt;/ref&gt;</div></td> <td class="diff-marker" data-marker="+"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>There are various types of inheritance, based on paradigm and specific language.&lt;ref&gt;{{cite web|url=https://www.cs.nmsu.edu/~rth/cs/cs177/map/inheritd.html|title=C++ Inheritance|website=www.cs.nmsu.edu<ins style="font-weight: bold; text-decoration: none;">|access-date=2018-05-16|archive-date=2023-09-24|archive-url=https://web.archive.org/web/20230924161416/https://www.cs.nmsu.edu/~rth/cs/cs177/map/inheritd.html|url-status=dead</ins>}}&lt;/ref&gt;</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>;Single inheritance</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>;Single inheritance</div></td> </tr> <tr> <td colspan="2" class="diff-lineno">Line 201:</td> <td colspan="2" class="diff-lineno">Line 201:</td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>According to [[Allen Holub]], the main problem with implementation inheritance is that it introduces unnecessary [[Coupling (computer programming)|coupling]] in the form of the [[Fragile base class|"fragile base class problem"]]:{{r|Mikhajlov}} modifications to the base class implementation can cause inadvertent behavioral changes in subclasses. Using interfaces avoids this problem because no implementation is shared, only the API.{{r|holub}} Another way of stating this is that "inheritance breaks [[Encapsulation (object-oriented programming)|encapsulation]]".&lt;ref&gt;{{Cite journal | doi = 10.1145/250707.239108| title = Evolution of object behavior using context relations| journal = ACM SIGSOFT Software Engineering Notes| volume = 21| issue = 6| page = 46| year = 1996| last1 = Seiter | first1 = Linda M.| last2 = Palsberg | first2 = Jens| last3 = Lieberherr | first3 = Karl J.| url = http://www.ccs.neu.edu/research/demeter/papers/context-journal/_context.html| citeseerx = 10.1.1.36.5053}}&lt;/ref&gt; The problem surfaces clearly in open object-oriented systems such as [[Software framework|frameworks]], where client code is expected to inherit from system-supplied classes and then substituted for the system's classes in its algorithms.{{r|Mikhajlov}}</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>According to [[Allen Holub]], the main problem with implementation inheritance is that it introduces unnecessary [[Coupling (computer programming)|coupling]] in the form of the [[Fragile base class|"fragile base class problem"]]:{{r|Mikhajlov}} modifications to the base class implementation can cause inadvertent behavioral changes in subclasses. Using interfaces avoids this problem because no implementation is shared, only the API.{{r|holub}} Another way of stating this is that "inheritance breaks [[Encapsulation (object-oriented programming)|encapsulation]]".&lt;ref&gt;{{Cite journal | doi = 10.1145/250707.239108| title = Evolution of object behavior using context relations| journal = ACM SIGSOFT Software Engineering Notes| volume = 21| issue = 6| page = 46| year = 1996| last1 = Seiter | first1 = Linda M.| last2 = Palsberg | first2 = Jens| last3 = Lieberherr | first3 = Karl J.| url = http://www.ccs.neu.edu/research/demeter/papers/context-journal/_context.html| citeseerx = 10.1.1.36.5053}}&lt;/ref&gt; The problem surfaces clearly in open object-oriented systems such as [[Software framework|frameworks]], where client code is expected to inherit from system-supplied classes and then substituted for the system's classes in its algorithms.{{r|Mikhajlov}}</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td> </tr> <tr> <td class="diff-marker" data-marker="−"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>Reportedly, Java inventor [[James Gosling]] has spoken against implementation inheritance, stating that he would not include it if he were to redesign Java.&lt;ref name="holub"&gt;{{cite web |first=Allen |last=Holub |author-link=Allen Holub |url=http://www.javaworld.com/article/2073649/core-java/why-extends-is-evil.html |title=Why extends is evil |date=1 August 2003 |access-date=10 March 2015}}&lt;/ref&gt; Language designs that decouple inheritance from subtyping (interface inheritance) appeared as early as 1990;&lt;ref&gt;{{Cite conference| doi = 10.1007/BFb0019440| title = Designing an object-oriented programming language with behavioural subtyping| conference = REX School/Workshop on the Foundations of Object-Oriented Languages| volume = 489| pages = 60–90| series = Lecture Notes in Computer Science| year = 1991| last1 = America | first1 = Pierre| isbn = 978-3-540-53931-5| url = https://www.researchgate.net/publication/221501695}}&lt;/ref&gt; a modern example of this is the [[Go (programming language)|Go]] programming language.</div></td> <td class="diff-marker" data-marker="+"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>Reportedly, Java inventor [[James Gosling]] has spoken against implementation inheritance, stating that he would not include it if he were to redesign Java.&lt;ref name="holub"&gt;{{cite web |first=Allen |last=Holub |author-link=Allen Holub |url=http://www.javaworld.com/article/2073649/core-java/why-extends-is-evil.html |title=Why extends is evil |date=1 August 2003 |access-date=10 March 2015<ins style="font-weight: bold; text-decoration: none;"> |archive-date=24 February 2019 |archive-url=https://web.archive.org/web/20190224073940/https://www.javaworld.com/article/2073649/core-java/why-extends-is-evil.html |url-status=dead </ins>}}&lt;/ref&gt; Language designs that decouple inheritance from subtyping (interface inheritance) appeared as early as 1990;&lt;ref&gt;{{Cite conference| doi = 10.1007/BFb0019440| title = Designing an object-oriented programming language with behavioural subtyping| conference = REX School/Workshop on the Foundations of Object-Oriented Languages| volume = 489| pages = 60–90| series = Lecture Notes in Computer Science| year = 1991| last1 = America | first1 = Pierre| isbn = 978-3-540-53931-5| url = https://www.researchgate.net/publication/221501695}}&lt;/ref&gt; a modern example of this is the [[Go (programming language)|Go]] programming language.</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Complex inheritance, or inheritance used within an insufficiently mature design, may lead to the [[yo-yo problem]]. When inheritance was used as a primary approach to structure programs in the late 1990s, developers tended to break code into more layers of inheritance as the system functionality grew. If a development team combined multiple layers of inheritance with the single responsibility principle, this resulted in many very thin layers of code, with many layers consisting of only 1 or 2 lines of actual code.{{Citation needed|date=October 2022}} Too many layers make debugging a significant challenge, as it becomes hard to determine which layer needs to be debugged.</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Complex inheritance, or inheritance used within an insufficiently mature design, may lead to the [[yo-yo problem]]. When inheritance was used as a primary approach to structure programs in the late 1990s, developers tended to break code into more layers of inheritance as the system functionality grew. If a development team combined multiple layers of inheritance with the single responsibility principle, this resulted in many very thin layers of code, with many layers consisting of only 1 or 2 lines of actual code.{{Citation needed|date=October 2022}} Too many layers make debugging a significant challenge, as it becomes hard to determine which layer needs to be debugged.</div></td> </tr> </table> InternetArchiveBot https://en.wikipedia.org/w/index.php?title=Inheritance_(object-oriented_programming)&diff=1192201504&oldid=prev Graham87: mass-revert edits by user who often violates Wikipedia's Manual of Style; if you think the edit/s I have undone were an improvement, feel free to revert me 2023-12-28T04:44:16Z <p>mass-revert edits by user who often violates Wikipedia&#039;s Manual of Style; if you think the edit/s I have undone were an improvement, feel free to revert me</p> <table style="background-color: #fff; color: #202122;" data-mw="interface"> <col class="diff-marker" /> <col class="diff-content" /> <col class="diff-marker" /> <col class="diff-content" /> <tr class="diff-title" lang="en"> <td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Previous revision</td> <td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 04:44, 28 December 2023</td> </tr><tr> <td colspan="2" class="diff-lineno">Line 11:</td> <td colspan="2" class="diff-lineno">Line 11:</td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>== History ==</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>== History ==</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td> </tr> <tr> <td class="diff-marker" data-marker="−"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>In 1966, [[Tony Hoare]] presented some remarks on records, and in particular presented the idea of record subclasses, record types with common properties but discriminated by a variant tag and having fields private to the variant.&lt;ref&gt;{{cite tech report |last1=Hoare |first1=C. A. R. |title=Record Handling |date=1966 |url=http://archive.computerhistory.org/resources/text/Knuth_Don_X4100/PDF_index/k-9-pdf/k-9-u2293-Record-Handling-Hoare.pdf|pages=15-16}}&lt;/ref&gt; Influenced by this, in 1967<del style="font-weight: bold; text-decoration: none;">,</del> [[Ole-Johan Dahl]] and [[Kristen Nygaard]] presented a design that allowed specifying objects that belonged to different classes but had common properties. The common properties were collected in a superclass, and each superclass could itself potentially have a superclass. The values of a subclass were thus compound objects, consisting of some number of prefix parts belonging to various superclasses, plus a main part belonging to the subclass. These parts were all concatenated together.&lt;ref&gt;{{cite conference|first1=Ole-Johan|last1=Dahl|first2=Kristen|last2=Nygaard|title=Class and subclass declarations|publisher=Norwegian Computing Center|conference=IFIP Working Conference on Simulation Languages|place=Oslo|date =May 1967|url=https://www.ub.uio.no/fag/naturvitenskap-teknologi/informatikk/faglig/dns/dokumenter/classandsubclass1967.pdf}}&lt;/ref&gt; The attributes of a compound object would be accessible by dot notation. This idea was first adopted in the [[Simula]] 67 programming language.&lt;ref&gt;{{cite book |last1=Dahl |first1=Ole-Johan |chapter=The Birth of Object Orientation: the Simula Languages |journal=From Object-Orientation to Formal Methods |series=Lecture Notes in Computer Science |date=2004 |volume=2635 |pages=15–25 |doi=10.1007/978-3-540-39993-3_3 |isbn=978-3-540-21366-6 |chapter-url=https://www.mn.uio.no/ifi/english/about/ole-johan-dahl/bibliography/the-birth-of-object-orientation-the-simula-languages.pdf}}&lt;/ref&gt; The idea then spread to [[Smalltalk]], [[C++]], [[Java (programming language)|Java]], [[Python (programming language)|Python]], and many other languages.</div></td> <td class="diff-marker" data-marker="+"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>In 1966, [[Tony Hoare]] presented some remarks on records, and in particular presented the idea of record subclasses, record types with common properties but discriminated by a variant tag and having fields private to the variant.&lt;ref&gt;{{cite tech report |last1=Hoare |first1=C. A. R. |title=Record Handling |date=1966 |url=http://archive.computerhistory.org/resources/text/Knuth_Don_X4100/PDF_index/k-9-pdf/k-9-u2293-Record-Handling-Hoare.pdf|pages=15-16}}&lt;/ref&gt; Influenced by this, in 1967 [[Ole-Johan Dahl]] and [[Kristen Nygaard]] presented a design that allowed specifying objects that belonged to different classes but had common properties. The common properties were collected in a superclass, and each superclass could itself potentially have a superclass. The values of a subclass were thus compound objects, consisting of some number of prefix parts belonging to various superclasses, plus a main part belonging to the subclass. These parts were all concatenated together.&lt;ref&gt;{{cite conference|first1=Ole-Johan|last1=Dahl|first2=Kristen|last2=Nygaard|title=Class and subclass declarations|publisher=Norwegian Computing Center|conference=IFIP Working Conference on Simulation Languages|place=Oslo|date =May 1967|url=https://www.ub.uio.no/fag/naturvitenskap-teknologi/informatikk/faglig/dns/dokumenter/classandsubclass1967.pdf}}&lt;/ref&gt; The attributes of a compound object would be accessible by dot notation. This idea was first adopted in the [[Simula]] 67 programming language.&lt;ref&gt;{{cite book |last1=Dahl |first1=Ole-Johan |chapter=The Birth of Object Orientation: the Simula Languages |journal=From Object-Orientation to Formal Methods |series=Lecture Notes in Computer Science |date=2004 |volume=2635 |pages=15–25 |doi=10.1007/978-3-540-39993-3_3 |isbn=978-3-540-21366-6 |chapter-url=https://www.mn.uio.no/ifi/english/about/ole-johan-dahl/bibliography/the-birth-of-object-orientation-the-simula-languages.pdf}}&lt;/ref&gt; The idea then spread to [[Smalltalk]], [[C++]], [[Java (programming language)|Java]], [[Python (programming language)|Python]], and many other languages.</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>==Types==</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>==Types==</div></td> </tr> </table> Graham87 https://en.wikipedia.org/w/index.php?title=Inheritance_(object-oriented_programming)&diff=1191380064&oldid=prev Rager7: again comma posrt dates 2023-12-23T05:26:43Z <p>again comma posrt dates</p> <table style="background-color: #fff; color: #202122;" data-mw="interface"> <col class="diff-marker" /> <col class="diff-content" /> <col class="diff-marker" /> <col class="diff-content" /> <tr class="diff-title" lang="en"> <td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Previous revision</td> <td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 05:26, 23 December 2023</td> </tr><tr> <td colspan="2" class="diff-lineno">Line 11:</td> <td colspan="2" class="diff-lineno">Line 11:</td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>== History ==</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>== History ==</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td> </tr> <tr> <td class="diff-marker" data-marker="−"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>In 1966, [[Tony Hoare]] presented some remarks on records, and in particular presented the idea of record subclasses, record types with common properties but discriminated by a variant tag and having fields private to the variant.&lt;ref&gt;{{cite tech report |last1=Hoare |first1=C. A. R. |title=Record Handling |date=1966 |url=http://archive.computerhistory.org/resources/text/Knuth_Don_X4100/PDF_index/k-9-pdf/k-9-u2293-Record-Handling-Hoare.pdf|pages=15-16}}&lt;/ref&gt; Influenced by this, in 1967 [[Ole-Johan Dahl]] and [[Kristen Nygaard]] presented a design that allowed specifying objects that belonged to different classes but had common properties. The common properties were collected in a superclass, and each superclass could itself potentially have a superclass. The values of a subclass were thus compound objects, consisting of some number of prefix parts belonging to various superclasses, plus a main part belonging to the subclass. These parts were all concatenated together.&lt;ref&gt;{{cite conference|first1=Ole-Johan|last1=Dahl|first2=Kristen|last2=Nygaard|title=Class and subclass declarations|publisher=Norwegian Computing Center|conference=IFIP Working Conference on Simulation Languages|place=Oslo|date =May 1967|url=https://www.ub.uio.no/fag/naturvitenskap-teknologi/informatikk/faglig/dns/dokumenter/classandsubclass1967.pdf}}&lt;/ref&gt; The attributes of a compound object would be accessible by dot notation. This idea was first adopted in the [[Simula]] 67 programming language.&lt;ref&gt;{{cite book |last1=Dahl |first1=Ole-Johan |chapter=The Birth of Object Orientation: the Simula Languages |journal=From Object-Orientation to Formal Methods |series=Lecture Notes in Computer Science |date=2004 |volume=2635 |pages=15–25 |doi=10.1007/978-3-540-39993-3_3 |isbn=978-3-540-21366-6 |chapter-url=https://www.mn.uio.no/ifi/english/about/ole-johan-dahl/bibliography/the-birth-of-object-orientation-the-simula-languages.pdf}}&lt;/ref&gt; The idea then spread to [[Smalltalk]], [[C++]], [[Java (programming language)|Java]], [[Python (programming language)|Python]], and many other languages.</div></td> <td class="diff-marker" data-marker="+"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>In 1966, [[Tony Hoare]] presented some remarks on records, and in particular presented the idea of record subclasses, record types with common properties but discriminated by a variant tag and having fields private to the variant.&lt;ref&gt;{{cite tech report |last1=Hoare |first1=C. A. R. |title=Record Handling |date=1966 |url=http://archive.computerhistory.org/resources/text/Knuth_Don_X4100/PDF_index/k-9-pdf/k-9-u2293-Record-Handling-Hoare.pdf|pages=15-16}}&lt;/ref&gt; Influenced by this, in 1967<ins style="font-weight: bold; text-decoration: none;">,</ins> [[Ole-Johan Dahl]] and [[Kristen Nygaard]] presented a design that allowed specifying objects that belonged to different classes but had common properties. The common properties were collected in a superclass, and each superclass could itself potentially have a superclass. The values of a subclass were thus compound objects, consisting of some number of prefix parts belonging to various superclasses, plus a main part belonging to the subclass. These parts were all concatenated together.&lt;ref&gt;{{cite conference|first1=Ole-Johan|last1=Dahl|first2=Kristen|last2=Nygaard|title=Class and subclass declarations|publisher=Norwegian Computing Center|conference=IFIP Working Conference on Simulation Languages|place=Oslo|date =May 1967|url=https://www.ub.uio.no/fag/naturvitenskap-teknologi/informatikk/faglig/dns/dokumenter/classandsubclass1967.pdf}}&lt;/ref&gt; The attributes of a compound object would be accessible by dot notation. This idea was first adopted in the [[Simula]] 67 programming language.&lt;ref&gt;{{cite book |last1=Dahl |first1=Ole-Johan |chapter=The Birth of Object Orientation: the Simula Languages |journal=From Object-Orientation to Formal Methods |series=Lecture Notes in Computer Science |date=2004 |volume=2635 |pages=15–25 |doi=10.1007/978-3-540-39993-3_3 |isbn=978-3-540-21366-6 |chapter-url=https://www.mn.uio.no/ifi/english/about/ole-johan-dahl/bibliography/the-birth-of-object-orientation-the-simula-languages.pdf}}&lt;/ref&gt; The idea then spread to [[Smalltalk]], [[C++]], [[Java (programming language)|Java]], [[Python (programming language)|Python]], and many other languages.</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>==Types==</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>==Types==</div></td> </tr> </table> Rager7 https://en.wikipedia.org/w/index.php?title=Inheritance_(object-oriented_programming)&diff=1190166199&oldid=prev Citation bot: Alter: template type. Add: chapter-url, chapter. Removed or converted URL. Removed parameters. Some additions/deletions were parameter name changes. | Use this bot. Report bugs. | Suggested by Abductive | Category:Cleanup tagged articles with a reason field from April 2015 | #UCB_Category 35/39 2023-12-16T09:13:46Z <p>Alter: template type. Add: chapter-url, chapter. Removed or converted URL. Removed parameters. Some additions/deletions were parameter name changes. | <a href="/wiki/Wikipedia:UCB" class="mw-redirect" title="Wikipedia:UCB">Use this bot</a>. <a href="/wiki/Wikipedia:DBUG" class="mw-redirect" title="Wikipedia:DBUG">Report bugs</a>. | Suggested by Abductive | <a href="/wiki/Category:Cleanup_tagged_articles_with_a_reason_field_from_April_2015" title="Category:Cleanup tagged articles with a reason field from April 2015">Category:Cleanup tagged articles with a reason field from April 2015</a> | #UCB_Category 35/39</p> <table style="background-color: #fff; color: #202122;" data-mw="interface"> <col class="diff-marker" /> <col class="diff-content" /> <col class="diff-marker" /> <col class="diff-content" /> <tr class="diff-title" lang="en"> <td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Previous revision</td> <td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 09:13, 16 December 2023</td> </tr><tr> <td colspan="2" class="diff-lineno">Line 11:</td> <td colspan="2" class="diff-lineno">Line 11:</td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>== History ==</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>== History ==</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td> </tr> <tr> <td class="diff-marker" data-marker="−"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>In 1966, [[Tony Hoare]] presented some remarks on records, and in particular presented the idea of record subclasses, record types with common properties but discriminated by a variant tag and having fields private to the variant.&lt;ref&gt;{{cite tech report |last1=Hoare |first1=C. A. R. |title=Record Handling |date=1966 |url=http://archive.computerhistory.org/resources/text/Knuth_Don_X4100/PDF_index/k-9-pdf/k-9-u2293-Record-Handling-Hoare.pdf|pages=15-16}}&lt;/ref&gt; Influenced by this, in 1967 [[Ole-Johan Dahl]] and [[Kristen Nygaard]] presented a design that allowed specifying objects that belonged to different classes but had common properties. The common properties were collected in a superclass, and each superclass could itself potentially have a superclass. The values of a subclass were thus compound objects, consisting of some number of prefix parts belonging to various superclasses, plus a main part belonging to the subclass. These parts were all concatenated together.&lt;ref&gt;{{cite conference|first1=Ole-Johan|last1=Dahl|first2=Kristen|last2=Nygaard|title=Class and subclass declarations|publisher=Norwegian Computing Center|conference=IFIP Working Conference on Simulation Languages|place=Oslo|date =May 1967|url=https://www.ub.uio.no/fag/naturvitenskap-teknologi/informatikk/faglig/dns/dokumenter/classandsubclass1967.pdf}}&lt;/ref&gt; The attributes of a compound object would be accessible by dot notation. This idea was first adopted in the [[Simula]] 67 programming language.&lt;ref&gt;{{cite <del style="font-weight: bold; text-decoration: none;">journal</del> |last1=Dahl |first1=Ole-Johan |<del style="font-weight: bold; text-decoration: none;">title</del>=The Birth of Object Orientation: the Simula Languages |journal=From Object-Orientation to Formal Methods |series=Lecture Notes in Computer Science |date=2004 |volume=2635 |pages=15–25 |doi=10.1007/978-3-540-39993-3_3 |isbn=978-3-540-21366-6 |url=https://www.mn.uio.no/ifi/english/about/ole-johan-dahl/bibliography/the-birth-of-object-orientation-the-simula-languages.pdf}}&lt;/ref&gt; The idea then spread to [[Smalltalk]], [[C++]], [[Java (programming language)|Java]], [[Python (programming language)|Python]], and many other languages.</div></td> <td class="diff-marker" data-marker="+"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>In 1966, [[Tony Hoare]] presented some remarks on records, and in particular presented the idea of record subclasses, record types with common properties but discriminated by a variant tag and having fields private to the variant.&lt;ref&gt;{{cite tech report |last1=Hoare |first1=C. A. R. |title=Record Handling |date=1966 |url=http://archive.computerhistory.org/resources/text/Knuth_Don_X4100/PDF_index/k-9-pdf/k-9-u2293-Record-Handling-Hoare.pdf|pages=15-16}}&lt;/ref&gt; Influenced by this, in 1967 [[Ole-Johan Dahl]] and [[Kristen Nygaard]] presented a design that allowed specifying objects that belonged to different classes but had common properties. The common properties were collected in a superclass, and each superclass could itself potentially have a superclass. The values of a subclass were thus compound objects, consisting of some number of prefix parts belonging to various superclasses, plus a main part belonging to the subclass. These parts were all concatenated together.&lt;ref&gt;{{cite conference|first1=Ole-Johan|last1=Dahl|first2=Kristen|last2=Nygaard|title=Class and subclass declarations|publisher=Norwegian Computing Center|conference=IFIP Working Conference on Simulation Languages|place=Oslo|date =May 1967|url=https://www.ub.uio.no/fag/naturvitenskap-teknologi/informatikk/faglig/dns/dokumenter/classandsubclass1967.pdf}}&lt;/ref&gt; The attributes of a compound object would be accessible by dot notation. This idea was first adopted in the [[Simula]] 67 programming language.&lt;ref&gt;{{cite <ins style="font-weight: bold; text-decoration: none;">book</ins> |last1=Dahl |first1=Ole-Johan |<ins style="font-weight: bold; text-decoration: none;">chapter</ins>=The Birth of Object Orientation: the Simula Languages |journal=From Object-Orientation to Formal Methods |series=Lecture Notes in Computer Science |date=2004 |volume=2635 |pages=15–25 |doi=10.1007/978-3-540-39993-3_3 |isbn=978-3-540-21366-6 |<ins style="font-weight: bold; text-decoration: none;">chapter-</ins>url=https://www.mn.uio.no/ifi/english/about/ole-johan-dahl/bibliography/the-birth-of-object-orientation-the-simula-languages.pdf}}&lt;/ref&gt; The idea then spread to [[Smalltalk]], [[C++]], [[Java (programming language)|Java]], [[Python (programming language)|Python]], and many other languages.</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>==Types==</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>==Types==</div></td> </tr> </table> Citation bot https://en.wikipedia.org/w/index.php?title=Inheritance_(object-oriented_programming)&diff=1176605835&oldid=prev HeyElliott: WP:N'T 2023-09-22T20:31:06Z <p><a href="/wiki/Wikipedia:N%27T" class="mw-redirect" title="Wikipedia:N&#039;T">WP:N&#039;T</a></p> <table style="background-color: #fff; color: #202122;" data-mw="interface"> <col class="diff-marker" /> <col class="diff-content" /> <col class="diff-marker" /> <col class="diff-content" /> <tr class="diff-title" lang="en"> <td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Previous revision</td> <td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 20:31, 22 September 2023</td> </tr><tr> <td colspan="2" class="diff-lineno">Line 60:</td> <td colspan="2" class="diff-lineno">Line 60:</td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>In some languages a class may be declared as [[Class (computer programming)#Non-subclassable|non-subclassable]] by adding certain [[class modifier]]s to the class declaration. Examples include the &lt;code&gt;final&lt;/code&gt; keyword in [[Final (Java)|Java]] and [[C++11]] onwards or the &lt;code&gt;sealed&lt;/code&gt; keyword in C#. Such modifiers are added to the class declaration before the &lt;code&gt;class&lt;/code&gt; keyword and the class identifier declaration. Such non-subclassable classes restrict [[reusability]], particularly when developers only have access to precompiled [[Binary file|binaries]] and not [[source code]].</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>In some languages a class may be declared as [[Class (computer programming)#Non-subclassable|non-subclassable]] by adding certain [[class modifier]]s to the class declaration. Examples include the &lt;code&gt;final&lt;/code&gt; keyword in [[Final (Java)|Java]] and [[C++11]] onwards or the &lt;code&gt;sealed&lt;/code&gt; keyword in C#. Such modifiers are added to the class declaration before the &lt;code&gt;class&lt;/code&gt; keyword and the class identifier declaration. Such non-subclassable classes restrict [[reusability]], particularly when developers only have access to precompiled [[Binary file|binaries]] and not [[source code]].</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td> </tr> <tr> <td class="diff-marker" data-marker="−"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>A non-subclassable class has no subclasses, so it can be easily deduced at [[compile time]] that references or pointers to objects of that class are actually referencing instances of that class and not instances of subclasses (they <del style="font-weight: bold; text-decoration: none;">don't</del> exist) or instances of superclasses ([[upcasting]] a reference type violates the type system). Because the exact type of the object being referenced is known before execution, [[early binding]] (also called [[static dispatch]]) can be used instead of [[late binding]] (also called [[dynamic dispatch]]), which requires one or more [[virtual method table]] lookups depending on whether [[multiple inheritance]] or only [[single inheritance]] are supported in the programming language that is being used.</div></td> <td class="diff-marker" data-marker="+"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>A non-subclassable class has no subclasses, so it can be easily deduced at [[compile time]] that references or pointers to objects of that class are actually referencing instances of that class and not instances of subclasses (they <ins style="font-weight: bold; text-decoration: none;">do not</ins> exist) or instances of superclasses ([[upcasting]] a reference type violates the type system). Because the exact type of the object being referenced is known before execution, [[early binding]] (also called [[static dispatch]]) can be used instead of [[late binding]] (also called [[dynamic dispatch]]), which requires one or more [[virtual method table]] lookups depending on whether [[multiple inheritance]] or only [[single inheritance]] are supported in the programming language that is being used.</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>=== Non-overridable methods ===</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>=== Non-overridable methods ===</div></td> </tr> </table> HeyElliott