Can CDI be reduced towards Java SE?

JSR-330 dependency injection can be applied to both Java SE and Java EE environments, while JSR-299 is called "Contexts and Dependency Injections for the Java EE Platform".

Besides strictly Java-oriented EE functions, which CDI functions make sense in Java SE as well? Are there any examples? Thanks!

[After revision] Here is Welding at JSE.

+7
java java-ee dependency-injection cdi jboss-weld
source share
2 answers

Besides strictly Java-oriented EE functions, which CDI functions make sense in Java SE as well? Are there any examples? Thanks!

Well, the one mentioned in the Weld documentation:

18.4. Java SE

In addition to improved integration, the Enterprise Enterprise stack, “Contexts and dependency injection for the Java EE platform specification” also defines the current state of a typical, state dependent injection, which can prove useful in a wide range of types of applications. To help developers take advantage of this, Weld provides simple tools to run in the Java Standard Edition (SE) environment, independent of any Java EE APIs.

When run in an SE environment, the following Weld features are: available:

  • Managed beans with @PostConstruct and @PreDestroy callbacks
  • Include dependencies with qualifiers and alternatives
  • @ Applications, @ Independent and @Singleton areas
  • Interceptors and Decorators
  • Stereotypes
  • Events

This obviously makes sense in the context of Java SE.

+7
source share

see openwebbeans.apache.org

+1
source share

All Articles