Learn

Composition Root

Keep concrete construction in one application boundary and inject dependencies into ordinary objects.

v0.1.0-dev.1Intermediateark_di

Composition Root

A Composition Root is the application location that knows concrete types and connects them to abstract contracts. In a console program it may be main(). In Flutter it normally runs during bootstrap before the root widget is built.

Domain and Application objects should receive dependencies through constructors. They do not need to import Ark DI or call a container.

text
bootstrap
  → DiContainer.build
      → technical clients
      → DataSources
      → Repositories
      → UseCases and services
  → application root

Container configuration may construct the graph, but business mapping and operation policy remain in the objects that own that behavior.

ARKTELOS

Purpose-built engineering systems for software that has to hold.