JavaEE CDI - Contexts and Dependency Injection
CDI (Contexts and Dependency Injection) is a standard dependency injection framework included in Java EE 6 onwards. CDI is also part of the Eclipse MicroProfile project, a framework use for development of Microservice application. ### CDI Releases | CDI Version | Release Year| |:-----------:|:-----------:| | CDI 1.0 | 2009 | | CDI 1.1 | 2013 | | CDI 1.2 | 2014 | | CDI 2.0 | 2017 | | CDI 3.0 | 2020 | | CDI 4.0 | 2022 | ### New Features - Removal of deprecated code Ex - **@New** qualifier which was deprecated in version 1.1 - Change in Bean discovery Mode CDI 4.0 bean discovery mode is by default Annotated - Support for Java Module system ( introduced in Java v9) - Introducing CDI Lite #### The “beans.xml” File First, we must place a **beans.xml** file in the - **src/main/resources/META-INF/** folder with **bean-discovery-mode** set to ```all``` or ``annotated`` Even if this file doesn't contain any sp...