Learn

Registrations and ownership

Choose Instance, Factory, Lazy Singleton, async strategies, and explicit ownership correctly.

v0.1.0-dev.1Intermediateark_di

Registrations and ownership

StrategyResolution resultRetained by container
Instancesupplied objectyes, as a registration
Factorynew object per requestno
Async Factorynew Future result per requestno
Lazy Singletonone object after first requestyes
Async Lazy Singletonone successful async resultyes

DiOwnership.container means the container closes the registered Instance when a disposer is supplied. DiOwnership.external records that another owner controls its lifecycle.

A Factory is transient: the consumer that receives its object controls its reachability and lifecycle. Ark DI does not retain each Factory result in a hidden list.

ARKTELOS

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