DEV Community

Aashutosh Poudel
Aashutosh Poudel

Posted on

Compile time dependency injection in Java with Dagger2

This post is just for reference. Need to further look into how to use the compile time feature of Dagger2 in Spring/Spring boot. Spring sometimes relies on runtime dependency injection using reflection. Resource 1 (from Baeldung) has a easy to understand example of using Dagger2 to inject dependencies.

Resource:

  1. Introduction to Dagger 2
  2. Dagger 2 Documentation
  3. Inversion of Control & Dependency Injection in Spring

Top comments (0)