Content deleted Content added
remove tag, URLs look fine |
→top: remove old 'confusing' tag; maybe simplified but it'll always remain confusing to someone |
||
Line 1:
{{Short description|Software design pattern}}
[[File:UML diagram of composition over inheritance.svg|thumb|right|444px|This diagram shows how the fly and sound behavior of an animal can be designed in a flexible way by using the composition over inheritance design principle.<ref name="FHDPs" />]]
'''Composition over inheritance''' (or '''composite reuse principle''') in [[object-oriented programming]] (OOP) is the principle that classes should achieve [[Polymorphism (computer science)|polymorphic]] behavior and [[code reuse]] by their [[object composition|composition]] (by containing instances of other classes that implement the desired functionality) rather than [[Inheritance (computer science)|inheritance]] from a base or parent class.<ref>{{cite book
|