DInject has moved to avaje.io/inject - taking you there now ...
Documentation / DInject
DInject Dependency Injection
DInject is designed to be a fast and light dependency injection library for server-side Java and Kotlin developers.
It uses source code generation (like Dagger). There is no use of reflection or classpath scanning.
It is orientated to server-side use by providing similar functionality to Spring DI including Lifecycle support, @Factory + @Bean, @Primary + @Secondary and the ability to get beans from the context.
Based on JSR-330
DInject is based on JSR-330: Dependency Injection for Java - javax.inject with some extensions similar to Spring DI.
Spring DI like extensions
@Factory + @Bean
DInject has @Factory + @Bean which work the same as Spring DI's @Configuration + @Bean and also Micronaut's @Factory + @Bean.
This provides a more convenient alternative to the JSR-330 javax.inject.Provider<T> interface and is also more natural for people who familiar with Spring DI or Micronaut DI.
DInject has @Primary @Secondary annotations which work the same as Spring DI's @Primary @Secondary and also Micronaut DI's @Primary @Secondary.
These provide injection precedence in the case of injecting an implementation when multiple injection candidates are available.
Spring DI translation
|@Component, @Service, @Controller, @Repositoryemail@example.com.Singleton||Yes|
|Non standard extensions to JSR-330|
|@Configuration @Bean||@Factory @Bean||No|
Using libraries that provide their own AOP/enhancement makes DInject simpler and lighter.
The following are library recommendations for @Transactional, @Value and @Timed.