Skip to content

Glossary: Software Design Patterns in Java

Composition

Also written: composition over inheritance

Building an object from smaller part objects it holds and delegates to ("has-a"). A `Product` has a pricing part and a wrapping part.

Where the book teaches it

Related terms

DelegationHas-a / is-aClass explosion