<sod>'''Composition over inheritance''' (or '''Composite Reuse Principle''') in [[object-oriented programming]] is the principle that classes should achieve polymorphic behavior and [[code reuse]] by [[object composition|composition]] (containing other classes that implement the desired functionality), instead of through [[Inheritance (computer science)|inheritance]] (being a subclass).<ref>{{cite book<eod>
<sod>'''Composition over inheritance''' (or '''Composite Reuse Principle''') in [[object-oriented programming]] is the principle that classes should achieve 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<eod>