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 and impl if they don’t want to
Modularity - What parts ? 
Right now we are thinking of 3 parts : 
CDI Light : DI and events without normal scope and AOP 
Providing lighter CDI implementations 
Full CDI 
Full CDI with Java EE / other spec integration
Modularity - challenges 
Be sure of the parts - too much or not enough granularity 
Having an RI and TCK for each part can be an important 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 standard services: 
JPA 
Transaction 
Security
Enhancing events 
Making popular feature even more popular
Asynchronous Events 
@Inject 
Event<Payload> evt; 
public void fireAsyncWithCallBack() { 
evt.fireAsync(new Payload(), 
callBack -> System.out.println("Job done”)); 
} 
Using lambdas to provide 
optional callback
Events Ordering 
public void firstObserver(@Observes(1) Payload pl) {} 
public void secondObserver(@Observes(2) Payload pl) {}
AOP enhancement 
Support AOP on custom or produced bean 
Improve interceptor chaining 
Support Self Injection to call intercepted / decorated method from the same 
bean
SPI and contexts enhancement 
Standardise CDI boot 
Add helpers to create new metadata: 
AnnotatedTypeBuilder 
BeanBuilder 
Add SPI to activate / deactivate contexts
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 ?

3/3 : The path to CDI 2.0 - Antoine Sabot-Durand

  • 1.
    CDI 2.0 newfeatures
  • 3.
    Modularity Provide subspecs in CDI (called parts) that can be used independently Each part should have an implementation
  • 4.
    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 and impl if they don’t want to
  • 5.
    Modularity - Whatparts ? Right now we are thinking of 3 parts : CDI Light : DI and events without normal scope and AOP Providing lighter CDI implementations Full CDI Full CDI with Java EE / other spec integration
  • 6.
    Modularity - challenges Be sure of the parts - too much or not enough granularity Having an RI and TCK for each part can be an important work
  • 7.
    Java SE support using CDI outside Java EE
  • 8.
    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
  • 9.
    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 standard services: JPA Transaction Security
  • 10.
    Enhancing events Makingpopular feature even more popular
  • 11.
    Asynchronous Events @Inject Event<Payload> evt; public void fireAsyncWithCallBack() { evt.fireAsync(new Payload(), callBack -> System.out.println("Job done”)); } Using lambdas to provide optional callback
  • 12.
    Events Ordering publicvoid firstObserver(@Observes(1) Payload pl) {} public void secondObserver(@Observes(2) Payload pl) {}
  • 13.
    AOP enhancement SupportAOP on custom or produced bean Improve interceptor chaining Support Self Injection to call intercepted / decorated method from the same bean
  • 14.
    SPI and contextsenhancement Standardise CDI boot Add helpers to create new metadata: AnnotatedTypeBuilder BeanBuilder Add SPI to activate / deactivate contexts
  • 15.
    CDI 2.0 needsyou 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
  • 16.