Skip to content

Glossary: Software Design Patterns in Go

Composition

Also written: composing, compose

Building a value from other values it holds and hands work to ("has-a"). A `Product` with a pricing part and a wrapping part is composed, so new behavior is a new part instead of a new type.

Where the book teaches it

Related terms

DelegationEmbeddingHas-a / is-a