juniorDependency Injection
What is 'Pure DI' (Vanilla DI)?
Updated Apr 28, 2026
Short answer
Pure DI is the practice of applying Dependency Injection manually without using any automated DI framework or container.
Deep explanation
Instead of relying on reflection or magic to wire up dependencies, the application's root entry point manually instantiates all concrete classes and passes them into constructors. It is extremely fast, highly traceable, and requires zero external libraries.
Real-world example
Wiring up a small console application or microservice where the dependency graph is shallow and simple.
Common mistakes
- Thinking DI is impossible without installing a heavy framework like Spring or Autofac.
Follow-up questions
- What is the main drawback of Pure DI?