Recipes
Ark DI recipes
Focused registration, async, override, testing, and diagnostics patterns.
v1.1.0Intermediate
Ark DI recipes
Choose the recipe matching one registration or lifecycle decision. Use the tutorials for a complete object graph.
| Decision | Recipe |
|---|---|
| Should the container retain an existing object or create a transient one? | Choose Instance or Factory |
| How do concurrent callers share one asynchronous resource? | Share async initialization |
| How can a test replace part of an immutable production graph? | Override a production graph in tests |
| How should a constructor cycle be removed rather than hidden? | Diagnose circular dependencies |
Before selecting a recipe, identify the dependency owner and required lifetime. Registration syntax follows from those two decisions.