Composition Over Inheritance

Kind: principle

Layer: Structural Core

Aliases: Composite Reuse Principle

Record: architecture:composition-over-inheritance

Severity: recommended

Scope: class, component

Canonical: Ontology

A design rule that behavior is reused by holding and delegating to another object instead of extending its class.

Listed in Architecture principles, after Composability and before Reusability.

Requires

Reinforces

Enables

Conflicts with

In tension with

Tensions

Violated by

Refactored by

Severity

Category

Enforced by

Reinforced by

Linked from