Java - Dependency Injection (DI)


Dependency injection in Java.

This page is about injection of a java dependency in a class.



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

Powered by ComboStrap