Skip to content

Glossary: Software Design Patterns in Go

Composition root

Also written: composition roots

The one place, usually `main`, that builds the real parts and hands them to the code that needs them. For example, `main.go` creates the repo, bus and clock and wires them into `OrderService`.

Where the book teaches it

Related terms

Dependency injectionConstructor injection