Tutorials

Build a pure-Dart object graph

Configure async clients, repositories, services, child overrides, and dependency-ordered teardown.

v0.1.0-dev.1Intermediateark_di

Build a pure-Dart object graph

01

Define the Composition Root

Bind immutable configuration as an Instance. Bind an async client, Repository, and service as Lazy Singletons with explicit disposers.

02

Resolve the application service

Use getAsync<CatalogService>(). Ark DI initializes the client first, then the Repository and service, while recording the dependency graph.

03

Create a bounded preview Scope

Create a child and override the Repository with an in-memory implementation. Override its consuming service so the child graph captures the local Repository.

04

Close child before parent

Close the preview Scope, then the application container. Verify that services close before repositories and repositories before clients.

ARKTELOS

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