Skip to content

Glossary: Software Design Patterns in Java

Has-a / is-a

Also written: has-a, is-a, is a, has a

Composition says a product has a pricing rule; inheritance says a wholesale product is a product. Choose inheritance only when the child truly is a kind of the parent.

Where the book teaches it

Related terms

CompositionInheritanceLiskov substitution principle (LSP)