Documentation
Reference documentation for DDI – Dynamic Dependency Injection. Bootstrap, resolution rules, ClassResolver, Producers, scopes, compatibility.
DDI is a nano dependency-injection library for Core Java. Its defining feature is
runtime resolution: a ClassResolver is invoked on every @Inject lookup
and decides — in plain Java — which implementation to inject.
Start here if you’re new:
- Getting Started — Maven coordinates, your first
@Inject, the three lines that bootstrap the container. - Resolution Rules — the complete decision table: what happens for N implementations, M producers, with or without resolvers.
- ClassResolver — the dynamic part. How to write a resolver that picks an implementation per call.
- Producers —
@ProducesandProducer<T>for instances that need a factory. - Scopes — lifecycle management and the built-in
JVMSingletonInjectionScope. - Compatibility — JDK matrix and supported runtimes.
Looking for tasks instead of reference? See the Tutorials — recipes for pricing-tier routing, quota-aware degradation, role-based impl selection, feature flags, multi-tenancy and mocking.
Add DDI to your Maven build, bootstrap the container, and write your first @Inject.
The complete decision table DDI uses when resolving @Inject — for any combination of implementations, producers and resolvers.
The dynamic decision hook — how DDI's ClassResolver picks an implementation per @Inject lookup.
Producer<T> and the @Produces annotation — when DDI should call a factory instead of instantiating a class directly.
Lifecycle management in DDI — the built-in JVMSingletonInjectionScope and how to write your own scope.
Supported JDK versions, runtimes and frameworks for DDI.