View
441
Download
0
Category
Tags:
Preview:
DESCRIPTION
Allez plus Loin avec CDI En moins de 5 ans d’existence, Contexts and Dependency Injection (CDI) est devenue l’une des principale spécification de Java EE. Néanmoins, CDI est bien souvent perçu comme une simple solution d’injection de dépendance enrichie alors que cette spécification est bien plus riche que ça. Lors de cette présentation, après un rapide rappel des fonctionnalités de base de CDI, nous montrerons comment son utilisation avancée permet Java EE en intégrant des technologies legacy ou plus récent de manière naturelle. Nous finirons avec le travail en cours sur CDI 2.0 qui a commencé début septembre.
Citation preview
CDI 2.0 new features
ModularityProvide 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 supportusing 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 - challengesExtract “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 eventsMaking popular feature even more popular
Asynchronous Events
@InjectEvent<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 ?
Recommended