Spring DI comparison

Limitations relative to Spring DI

  • DInject only has Singleton scope
  • DInject does not have an equivalent to @Value
  • DInject does not have integrated AOP

Relative benefits

  • DInject uses Java annotation processing to generate Java source code to perform dependency injection (like Dagger)
  • DInject does not use classpath scanning (Spring users might use spring-component-indexer to avoid this)
  • DInject determines the ordering of dependency injection at compile time and not runtime
  • DInject does not use reflection

DInject performs DI using compiled code avoiding reflection and classpath scanning so it's fast with low overhead.