SlideShare a Scribd company logo
1 of 32
Download to read offline
The path to CDI 2.0 
@antoine_sd
Antoine Sabot-Durand 
Senior Software Engineer @Red Hat 
Java & OSS : 
CDI co-spec lead 
CDI community development 
Tech Lead on Agorava 
@antoine_sd
Agenda 
Flashback on CDI 1.0, 1.1 and 1.2 
Gathering feedback for CDI 2.0 
CDI 2.0 new features 
CDI 2.0 needs you
CDI 2.0 started one month ago 
JSR 365 was the first Java EE 8 JSR proposed and voted 
Expert Group is still in formation 
We have a lot of community momentum 
All contribution are accepted
Previously on CDI
CDI Timeline 
CDI 1.0 (Java EE 6) 
CDI 1.1 (Java EE 7) 
CDI 1.2 (1.1 MR) 
CDI 2.0 Starts 
Dec 2009 June 2013 Apr 2014 Sep 2014 
CDI 2.0 released 
2016
CDI 1.0 - December 2009 
A well-defined lifecycle for stateful objects bound to lifecycle contexts, where the 
set of contexts is extensible 
A sophisticated, typesafe dependency injection mechanism, including the ability to 
select dependencies at either development or deployment time, without verbose 
configuration 
The ability to decorate or to associate interceptors to objects with a typlsafve 
approach 
An event notification model 
An SPI allowing portable extensions to integrate cleanly with the container
CDI 1.1 - April 2013 
Add automatic enablement of CDI for beans with a scope annotation, and EJBs, in Java EE 
Add more introspection with event, bean, Decorator and interceptor meta data 
Ease access to bean manager from outside CDI with CDI class 
Moved interceptor binding to interceptors spec, allowing for reuse by other specifications 
Add global enablement of interceptors (see the Java Interceptors Specification 1.2), global enablement 
of decorators and alternatives, using the @Priority annotation 
Add scope activation and destruction callback events 
Add AlterableContext allowing bean instances to be explicitly destroyed 
Add Unmanaged allowing easy access to non-contexutal instances of beans
CDI 1.2 - April 2014 
Clarification in the spec regarding: 
CDI Lifecycle 
Events 
Reworking Bean defining annotation to avoid conflict with other JSR 330 
frameworks 
Clarification on conversation resolution 
OSGi official support in the API
Gathering feedback for CDI 2.0
Different sources 
Survey 
Jira requests 
For mer EG 
Feedback 
Other specs feedback
CDI 2.0 survey
About this survey… 
There was a survey before the survey 
Between May 28th and June 30th 
260 participants 
3 « demography » question 
20 new features to rate (from 1 to 5)
Who answered? 
I'm a developer using CDI on my projects 
I'm an advanced developer extending CDI on my projects 
I'm developing a framework based on CDI
CDI version they’re using 
CDI 1.0 CDI 1.1 CDI 1.2
What are their usage? 
Plain Java EE Servlet container Java SE
Results 1/2 
Features from most to less wanted av. rating 
Asynchronous method invocation 4,04 
Add asynchronous event support * 4,00 
@Startup for CDI 3,92 
Bootstrapping the container outside Java EE * 3,90 
AOP for produced or custom beans * 3,65 
Mutable container at runtime * 3,62 
Security support 3,61 
Observers ordering * 3,53 
Better event control 3,50 
Enhance SPI to give better access to all metadata 3,41
Results 2/2 
Feature from most to less wanted av. rating 
Better EAR support 3,32 
Helpers to manipulate and build CDI metadata 3,32 
An easier way to create AnnotationLiteral (and TypeLiteral) 3,27 
Context SPI easily pluggable by the container 3,24 
Configuration file 3,17 
CDI parts * 3,12 
Enhance SPI to retrieve Bean from its instances 3,1 
JMX support 3,07 
Introduce CDI Lite. * 2,78 
Aligment with portlet 3.0 2,02
CDI 2.0 new features
Modularity 
Provide sub specs in CDI (called parts) that can be used independently 
Each part should have an implementation
Modularity - Why ? 
We want to add new features to CDI without making it a bloated spec 
Having parts will help CDI adoption. Third party won’t have to get the whole 
spec if they don’t want to
Modularity - What parts ? 
Right now we are thinking of 3 parts : 
CDI Light : DI without events, contexts, AOP and SPI 
Providing CDI for mobile / constrained platform 
Events : bring the event bus out of DI 
Full CDI
Modularity - challenges 
Be sure of the parts - too much or not enough granularity 
Having an RI and TCK for each part can become huge work
Java SE support 
using CDI outside Java EE
Java SE support - Why? 
To provide a mean of building new stacks out of Java EE 
To boost CDI adoption for Spec working already on Java SE
Java SE support - challenges 
Extract “Java EE” features across the spec to create a chapter dedicated to it 
Decide what existing SE support we standardise 
Add SPI for CDI integration with other framework / spec
Enhancing events 
Asynchronous events 
Event ordering 
Event Range (war, ear, server, cluster)
AOP enhancement 
Support AOP on custom or produced bean 
Improve interceptor chaining 
Support AOP on inner calls
SPI and contexts enhancement 
Better access to all meta data created by CDI 
Provide a way to add bean at runtime 
Contexts enhancement for third party Spec 
Contexts not only based on thread approach
CDI 2.0 needs you 
CDI 2.0 specification is open to everyone 
Come on join us on the mailing list and IRC channel 
All infos on http://cdi-spec.org or by following to @cdispec on twitter 
The more we are the more we’ll deliver
Questions ?

More Related Content

What's hot

Continuous Integration on my work
Continuous Integration on my workContinuous Integration on my work
Continuous Integration on my work
Mu Chun Wang
 
Preventing Supply Chain Attacks on Open Source Software
Preventing Supply Chain Attacks on Open Source SoftwarePreventing Supply Chain Attacks on Open Source Software
Preventing Supply Chain Attacks on Open Source Software
All Things Open
 

What's hot (20)

New York Kubernetes: CI/CD Patterns for Kubernetes
New York Kubernetes: CI/CD Patterns for KubernetesNew York Kubernetes: CI/CD Patterns for Kubernetes
New York Kubernetes: CI/CD Patterns for Kubernetes
 
Scala on androids
Scala on androidsScala on androids
Scala on androids
 
Binary Authorization in Kubernetes
Binary Authorization in KubernetesBinary Authorization in Kubernetes
Binary Authorization in Kubernetes
 
Software Supply Chain Management with Grafeas and Kritis
Software Supply Chain Management with Grafeas and KritisSoftware Supply Chain Management with Grafeas and Kritis
Software Supply Chain Management with Grafeas and Kritis
 
Software Supply Chain Management with Grafeas and Kritis
Software Supply Chain Management with Grafeas and KritisSoftware Supply Chain Management with Grafeas and Kritis
Software Supply Chain Management with Grafeas and Kritis
 
OpenDDR and Jakarta MVC - JavaLand 2021
OpenDDR and Jakarta MVC - JavaLand 2021OpenDDR and Jakarta MVC - JavaLand 2021
OpenDDR and Jakarta MVC - JavaLand 2021
 
DevNexus 2019: MicroProfile and Jakarta EE - What's Next?
DevNexus 2019:  MicroProfile and Jakarta EE - What's Next?DevNexus 2019:  MicroProfile and Jakarta EE - What's Next?
DevNexus 2019: MicroProfile and Jakarta EE - What's Next?
 
Let your tests drive your code
Let your tests drive your codeLet your tests drive your code
Let your tests drive your code
 
AOTB2014: Agile Testing on the Java Platform
AOTB2014: Agile Testing on the Java PlatformAOTB2014: Agile Testing on the Java Platform
AOTB2014: Agile Testing on the Java Platform
 
OSGi, Eclipse and API Tooling
OSGi, Eclipse and API ToolingOSGi, Eclipse and API Tooling
OSGi, Eclipse and API Tooling
 
OpenDaylight Developers Experience 1.5: Eclipse Setup, HOT reload, future plans
OpenDaylight Developers Experience 1.5: Eclipse Setup, HOT reload, future plansOpenDaylight Developers Experience 1.5: Eclipse Setup, HOT reload, future plans
OpenDaylight Developers Experience 1.5: Eclipse Setup, HOT reload, future plans
 
Implementing Microservices with Jakarta EE and MicroProfile
Implementing Microservices with Jakarta EE and MicroProfileImplementing Microservices with Jakarta EE and MicroProfile
Implementing Microservices with Jakarta EE and MicroProfile
 
Professional iOS development
Professional iOS developmentProfessional iOS development
Professional iOS development
 
JavaEE & GlassFish UG - Digital JavaEE 7 New & Noteworthy by P.Pilgrim
JavaEE & GlassFish UG - Digital JavaEE 7 New & Noteworthy by P.PilgrimJavaEE & GlassFish UG - Digital JavaEE 7 New & Noteworthy by P.Pilgrim
JavaEE & GlassFish UG - Digital JavaEE 7 New & Noteworthy by P.Pilgrim
 
Automated Virtualized Testing (AVT) with Docker, Kubernetes, WireMock and Gat...
Automated Virtualized Testing (AVT) with Docker, Kubernetes, WireMock and Gat...Automated Virtualized Testing (AVT) with Docker, Kubernetes, WireMock and Gat...
Automated Virtualized Testing (AVT) with Docker, Kubernetes, WireMock and Gat...
 
The DevSecOps Builder’s Guide to the CI/CD Pipeline
The DevSecOps Builder’s Guide to the CI/CD PipelineThe DevSecOps Builder’s Guide to the CI/CD Pipeline
The DevSecOps Builder’s Guide to the CI/CD Pipeline
 
Continuous Integration on my work
Continuous Integration on my workContinuous Integration on my work
Continuous Integration on my work
 
Preventing Supply Chain Attacks on Open Source Software
Preventing Supply Chain Attacks on Open Source SoftwarePreventing Supply Chain Attacks on Open Source Software
Preventing Supply Chain Attacks on Open Source Software
 
Hands on React Native: From Zero to Hero
Hands on React  Native:  From Zero to HeroHands on React  Native:  From Zero to Hero
Hands on React Native: From Zero to Hero
 
OpenAPI Generator The Babel Fish of The API World - apidays Live Paris
OpenAPI Generator The Babel Fish of The API World - apidays Live ParisOpenAPI Generator The Babel Fish of The API World - apidays Live Paris
OpenAPI Generator The Babel Fish of The API World - apidays Live Paris
 

Viewers also liked

Introduction to cdi given at java one 2014
Introduction to cdi given at java one 2014Introduction to cdi given at java one 2014
Introduction to cdi given at java one 2014
Antoine Sabot-Durand
 

Viewers also liked (16)

Invoke dynamite in Java EE with invoke dynamic
Invoke dynamite in Java EE with invoke dynamicInvoke dynamite in Java EE with invoke dynamic
Invoke dynamite in Java EE with invoke dynamic
 
Going further with CDI 1.2
Going further with CDI 1.2Going further with CDI 1.2
Going further with CDI 1.2
 
Apache DeltaSpike the CDI toolbox
Apache DeltaSpike the CDI toolboxApache DeltaSpike the CDI toolbox
Apache DeltaSpike the CDI toolbox
 
Introduction to cdi given at java one 2014
Introduction to cdi given at java one 2014Introduction to cdi given at java one 2014
Introduction to cdi given at java one 2014
 
Mute Java EE DNA with CDI
Mute Java EE DNA with CDI Mute Java EE DNA with CDI
Mute Java EE DNA with CDI
 
Extending Java EE with CDI and JBoss Forge
Extending Java EE with CDI and JBoss ForgeExtending Java EE with CDI and JBoss Forge
Extending Java EE with CDI and JBoss Forge
 
Java EE, un ami qui vous veut du bien
Java EE, un ami qui vous veut du bienJava EE, un ami qui vous veut du bien
Java EE, un ami qui vous veut du bien
 
CDI 2.0 Deep Dive
CDI 2.0 Deep DiveCDI 2.0 Deep Dive
CDI 2.0 Deep Dive
 
The Magnificent java EE 7 in Wildfly-O-Rama
The Magnificent java EE 7 in Wildfly-O-RamaThe Magnificent java EE 7 in Wildfly-O-Rama
The Magnificent java EE 7 in Wildfly-O-Rama
 
Devoxx Java Social and Agorava
Devoxx Java Social and AgoravaDevoxx Java Social and Agorava
Devoxx Java Social and Agorava
 
Fais ce que tu veux avec Java EE - Devoxx France 2014
Fais ce que tu veux avec Java EE - Devoxx France 2014Fais ce que tu veux avec Java EE - Devoxx France 2014
Fais ce que tu veux avec Java EE - Devoxx France 2014
 
Electronic governance steps in the right direction?
Electronic governance   steps in the right direction?Electronic governance   steps in the right direction?
Electronic governance steps in the right direction?
 
Architecting Large Enterprise Projects @DevConf.CZ
Architecting Large Enterprise Projects @DevConf.CZArchitecting Large Enterprise Projects @DevConf.CZ
Architecting Large Enterprise Projects @DevConf.CZ
 
Kids computer-programming
Kids computer-programmingKids computer-programming
Kids computer-programming
 
Java 8, Streams & Collectors, patterns, performances and parallelization
Java 8, Streams & Collectors, patterns, performances and parallelizationJava 8, Streams & Collectors, patterns, performances and parallelization
Java 8, Streams & Collectors, patterns, performances and parallelization
 
CDI mis en pratique avec Seam Social et Weld OSGI
CDI mis en pratique avec Seam Social et Weld OSGICDI mis en pratique avec Seam Social et Weld OSGI
CDI mis en pratique avec Seam Social et Weld OSGI
 

Similar to The path to cdi 2.0

Similar to The path to cdi 2.0 (20)

3/3 : The path to CDI 2.0 - Antoine Sabot-Durand
3/3 : The path to CDI 2.0 - Antoine Sabot-Durand3/3 : The path to CDI 2.0 - Antoine Sabot-Durand
3/3 : The path to CDI 2.0 - Antoine Sabot-Durand
 
給 RD 的 Kubernetes 初體驗
給 RD 的 Kubernetes 初體驗給 RD 的 Kubernetes 初體驗
給 RD 的 Kubernetes 初體驗
 
Back from Microsoft //Build 2018
Back from Microsoft //Build 2018Back from Microsoft //Build 2018
Back from Microsoft //Build 2018
 
Speeding up your team with GitOps
Speeding up your team with GitOpsSpeeding up your team with GitOps
Speeding up your team with GitOps
 
Microsoft Ignite 2018 BRK3192 Container DevOps on Azure
Microsoft Ignite 2018 BRK3192 Container DevOps on AzureMicrosoft Ignite 2018 BRK3192 Container DevOps on Azure
Microsoft Ignite 2018 BRK3192 Container DevOps on Azure
 
Introduction to Eclipse Microprofile
Introduction to Eclipse MicroprofileIntroduction to Eclipse Microprofile
Introduction to Eclipse Microprofile
 
Fiware IoT Proposal and Community
Fiware IoT Proposal and CommunityFiware IoT Proposal and Community
Fiware IoT Proposal and Community
 
Microsoft, Linux, Open Source, DevOps
Microsoft, Linux, Open Source, DevOpsMicrosoft, Linux, Open Source, DevOps
Microsoft, Linux, Open Source, DevOps
 
Migrate or modernize your database applications using Azure SQL Database Mana...
Migrate or modernize your database applications using Azure SQL Database Mana...Migrate or modernize your database applications using Azure SQL Database Mana...
Migrate or modernize your database applications using Azure SQL Database Mana...
 
Android MVVM architecture using Kotlin, Dagger2, LiveData, MediatorLiveData
Android MVVM architecture using Kotlin, Dagger2, LiveData, MediatorLiveDataAndroid MVVM architecture using Kotlin, Dagger2, LiveData, MediatorLiveData
Android MVVM architecture using Kotlin, Dagger2, LiveData, MediatorLiveData
 
DevOps with Kubernetes and Helm - Jenkins World Edition
DevOps with Kubernetes and Helm - Jenkins World EditionDevOps with Kubernetes and Helm - Jenkins World Edition
DevOps with Kubernetes and Helm - Jenkins World Edition
 
CI and CD with Spinnaker
CI and CD with SpinnakerCI and CD with Spinnaker
CI and CD with Spinnaker
 
Delivering Quality at Speed with GitOps
Delivering Quality at Speed with GitOpsDelivering Quality at Speed with GitOps
Delivering Quality at Speed with GitOps
 
Hardening Your CI/CD Pipelines with GitOps and Continuous Security
Hardening Your CI/CD Pipelines with GitOps and Continuous SecurityHardening Your CI/CD Pipelines with GitOps and Continuous Security
Hardening Your CI/CD Pipelines with GitOps and Continuous Security
 
Apache DeltaSpike: The CDI Toolbox
Apache DeltaSpike: The CDI ToolboxApache DeltaSpike: The CDI Toolbox
Apache DeltaSpike: The CDI Toolbox
 
7 flavours of devops implementation
7 flavours of devops implementation7 flavours of devops implementation
7 flavours of devops implementation
 
TDD with BizTalk
TDD with BizTalkTDD with BizTalk
TDD with BizTalk
 
How Azure DevOps can boost your organization's productivity
How Azure DevOps can boost your organization's productivityHow Azure DevOps can boost your organization's productivity
How Azure DevOps can boost your organization's productivity
 
Managing Data in Jakarta EE Applications
Managing Data in Jakarta EE ApplicationsManaging Data in Jakarta EE Applications
Managing Data in Jakarta EE Applications
 
Microsoft Build 2023 Updates – Copilot Stack and Azure OpenAI Service (Machin...
Microsoft Build 2023 Updates – Copilot Stack and Azure OpenAI Service (Machin...Microsoft Build 2023 Updates – Copilot Stack and Azure OpenAI Service (Machin...
Microsoft Build 2023 Updates – Copilot Stack and Azure OpenAI Service (Machin...
 

Recently uploaded

introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
VishalKumarJha10
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
mohitmore19
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 

Recently uploaded (20)

The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
How to Choose the Right Laravel Development Partner in New York City_compress...
How to Choose the Right Laravel Development Partner in New York City_compress...How to Choose the Right Laravel Development Partner in New York City_compress...
How to Choose the Right Laravel Development Partner in New York City_compress...
 
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdfAzure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 

The path to cdi 2.0

  • 1. The path to CDI 2.0 @antoine_sd
  • 2. Antoine Sabot-Durand Senior Software Engineer @Red Hat Java & OSS : CDI co-spec lead CDI community development Tech Lead on Agorava @antoine_sd
  • 3. Agenda Flashback on CDI 1.0, 1.1 and 1.2 Gathering feedback for CDI 2.0 CDI 2.0 new features CDI 2.0 needs you
  • 4. CDI 2.0 started one month ago JSR 365 was the first Java EE 8 JSR proposed and voted Expert Group is still in formation We have a lot of community momentum All contribution are accepted
  • 6. CDI Timeline CDI 1.0 (Java EE 6) CDI 1.1 (Java EE 7) CDI 1.2 (1.1 MR) CDI 2.0 Starts Dec 2009 June 2013 Apr 2014 Sep 2014 CDI 2.0 released 2016
  • 7. CDI 1.0 - December 2009 A well-defined lifecycle for stateful objects bound to lifecycle contexts, where the set of contexts is extensible A sophisticated, typesafe dependency injection mechanism, including the ability to select dependencies at either development or deployment time, without verbose configuration The ability to decorate or to associate interceptors to objects with a typlsafve approach An event notification model An SPI allowing portable extensions to integrate cleanly with the container
  • 8. CDI 1.1 - April 2013 Add automatic enablement of CDI for beans with a scope annotation, and EJBs, in Java EE Add more introspection with event, bean, Decorator and interceptor meta data Ease access to bean manager from outside CDI with CDI class Moved interceptor binding to interceptors spec, allowing for reuse by other specifications Add global enablement of interceptors (see the Java Interceptors Specification 1.2), global enablement of decorators and alternatives, using the @Priority annotation Add scope activation and destruction callback events Add AlterableContext allowing bean instances to be explicitly destroyed Add Unmanaged allowing easy access to non-contexutal instances of beans
  • 9. CDI 1.2 - April 2014 Clarification in the spec regarding: CDI Lifecycle Events Reworking Bean defining annotation to avoid conflict with other JSR 330 frameworks Clarification on conversation resolution OSGi official support in the API
  • 11. Different sources Survey Jira requests For mer EG Feedback Other specs feedback
  • 13. About this survey… There was a survey before the survey Between May 28th and June 30th 260 participants 3 « demography » question 20 new features to rate (from 1 to 5)
  • 14. Who answered? I'm a developer using CDI on my projects I'm an advanced developer extending CDI on my projects I'm developing a framework based on CDI
  • 15. CDI version they’re using CDI 1.0 CDI 1.1 CDI 1.2
  • 16. What are their usage? Plain Java EE Servlet container Java SE
  • 17. Results 1/2 Features from most to less wanted av. rating Asynchronous method invocation 4,04 Add asynchronous event support * 4,00 @Startup for CDI 3,92 Bootstrapping the container outside Java EE * 3,90 AOP for produced or custom beans * 3,65 Mutable container at runtime * 3,62 Security support 3,61 Observers ordering * 3,53 Better event control 3,50 Enhance SPI to give better access to all metadata 3,41
  • 18. Results 2/2 Feature from most to less wanted av. rating Better EAR support 3,32 Helpers to manipulate and build CDI metadata 3,32 An easier way to create AnnotationLiteral (and TypeLiteral) 3,27 Context SPI easily pluggable by the container 3,24 Configuration file 3,17 CDI parts * 3,12 Enhance SPI to retrieve Bean from its instances 3,1 JMX support 3,07 Introduce CDI Lite. * 2,78 Aligment with portlet 3.0 2,02
  • 19. CDI 2.0 new features
  • 20.
  • 21. Modularity Provide sub specs in CDI (called parts) that can be used independently Each part should have an implementation
  • 22. Modularity - Why ? We want to add new features to CDI without making it a bloated spec Having parts will help CDI adoption. Third party won’t have to get the whole spec if they don’t want to
  • 23. Modularity - What parts ? Right now we are thinking of 3 parts : CDI Light : DI without events, contexts, AOP and SPI Providing CDI for mobile / constrained platform Events : bring the event bus out of DI Full CDI
  • 24. Modularity - challenges Be sure of the parts - too much or not enough granularity Having an RI and TCK for each part can become huge work
  • 25. Java SE support using CDI outside Java EE
  • 26. Java SE support - Why? To provide a mean of building new stacks out of Java EE To boost CDI adoption for Spec working already on Java SE
  • 27. Java SE support - challenges Extract “Java EE” features across the spec to create a chapter dedicated to it Decide what existing SE support we standardise Add SPI for CDI integration with other framework / spec
  • 28. Enhancing events Asynchronous events Event ordering Event Range (war, ear, server, cluster)
  • 29. AOP enhancement Support AOP on custom or produced bean Improve interceptor chaining Support AOP on inner calls
  • 30. SPI and contexts enhancement Better access to all meta data created by CDI Provide a way to add bean at runtime Contexts enhancement for third party Spec Contexts not only based on thread approach
  • 31. CDI 2.0 needs you CDI 2.0 specification is open to everyone Come on join us on the mailing list and IRC channel All infos on http://cdi-spec.org or by following to @cdispec on twitter The more we are the more we’ll deliver