DInject comparison

DInject is orientated for server use

  • DInject supports @PostConstruct and @PreDestroy lifecycle
  • DInject has @Factory and @Bean
  • DInject has support for supplying test doubles (similar to Spring test scope)

Both Dagger and DInject

  • Use Java annotation processing to generate Java source code to perform dependency injection
  • Do not use classpath scanning or reflection
  • Determine the ordering of dependency injection at compile time and not runtime
  • Support modularity (injecting dependencies across modules)
  • Only support Singleton scope