Composition terms

These terms name how a composition root describes an application's dependencies and how the application layer's lifecycle runs them. Every application type uses the same terms, so a CLI command and a web service describe and run their dependencies the same way, and a standard keeps the terms in its language's idiom.

The terms

Retired and kept terms

Why one graph serves every application type

A graph lets each entry point build only what it reaches. A CLI runs one command per process, so a command that declares only the database never constructs the object store, and help or a usage error constructs nothing. A web service builds every node its serving path reaches and runs that system for the process lifetime. One coordinator runs both, and go-core's graph and lifecycle realize it: go-web-service describes its composition root as one graph on that coordinator, and the CLI application type builds on the same one.

How a standard realizes participation, startup, and shutdown is stated at the standard's level: Go Elemental's is Lifecycle and context ownership.

Keyboard shortcuts

Settings