About
Dependency injection in Java.
This page is about injection of a java dependency in a class.
Articles Related
Library
- Google: Dagger is is dependency injection at compile time while Guice is at runtime
- https://dagger.dev/ (Google but originate from Square)
- Guice
Specification
JSR 330: Dependency Injection for Java
The standard Java annotations for describing the dependencies of a class are defined in the Java Specification Request 330 (JSR330).
This specification describes the following annotations:
- @Inject
- and @Named
JSR-299 - Contexts and Dependency Injection (CDI)
Contexts and Dependency Injection (CDI) is specified by JSR-299
It's a programming model. Dependency injection is when the EJB container automatically supplies (or injects) a variable or setter method in the bean file with a reference to another EJB or resource or another environment entry in the bean's context.
Bean files supports dependency injection.
Implementation. See weld with Vertx