# Avaje-Inject

Avaje-Inject is an annotation-processor-based dependency-injection library for server-side Java and Kotlin, generating wiring code at compile time instead of relying on runtime reflection or classpath scanning.

Avaje-Inject performs dependency injection for server-side Java and Kotlin applications using annotation processing at compile time, rather than reflection or classpath scanning at runtime, so applications start faster and with lower overhead. A class marked @Singleton has its dependencies supplied through its constructor, and a @Factory class with @Bean methods can provide instances that are not themselves annotated; a BeanScope built at startup then resolves and returns instances by type.

The annotation processor determines the dependency wiring order and generates an AvajeModule class that wires everything together, avoiding a separate reflection-based startup scan. Compared with Dagger, which it otherwise resembles in its annotation-processing and code-generation approach, Avaje-Inject targets server-side rather than Android development, adds component testing through a companion avaje-inject-test module and @InjectTest annotation, an API for retrieving every bean implementing a given interface, and @PostConstruct and @PreDestroy lifecycle callbacks.

Website: https://avaje.io/inject
