Skip to content

dev-VinayM/Dagger2Application

Repository files navigation

Dagger2Application

POC project on Dagger2

About Project :

Employee is dependent on Salary and ContactDetails.
Residence is dependent on Address.

dependencyGraph

Things to keep in mind :

Annotations :

  1. @Inject : tells the Dagger how to create instances of Employee
  2. @Module : tells Dagger how to provide dependencies from the dependency graph.
  3. @Provides :
  4. @Binds :
  5. @Component : tells Dagger to generate a container with all the dependencies required to satisfy the types it exposes.

Dependency Injection types :

  1. Constructor Injection: Injecting the method parameters.
  2. Field Injection: Injecting the member variable (must not be private).
  3. Method Injection: Injecting the method parameter.

Order of dependency injection according to JSR330 (Java Specification Requests) :

  1. Constructor
  2. Field
  3. Method

About

POC project on Dagger2

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages