SlideShare uma empresa Scribd logo
1 de 154
Baixar para ler offline
CDI : How do I ?
by antonio goncalves
@agoncal
2@agoncal
Antonio Goncalves
What is CDI ?
4@agoncal
What is CDI ?
● Dependency injection
● Lose coupling, strong typing
● Context management
● Interceptors and decorators
● Event bus
● Extensions
5@agoncal
History of CDI
6@agoncal
Implementations
Demo
-
Creating a Web App
8@agoncal
Demos with JBoss Forge
● Java EE scaffolding tool
● Shell commands
● CRUD application
● Gets you start quickly
● Takes care of integration
● Plugin based
9@agoncal
Demo: Creating a Web App
Dependency Injection
11@agoncal
How Do I ?
12@agoncal
Use @Inject !
13@agoncal
@Inject on Attributes
public class BookBean implements Serializable {
@Inject
private NumberGenerator numberGenerator;
@Inject
private ItemService itemService;
// ...
}
14@agoncal
@Inject on Constructor
public class BookBean implements Serializable {
private NumberGenerator numberGenerator;
private ItemService itemService;
@Inject
public BookBean(NumberGenerator numberGenerator,
ItemService srv){
this.numberGenerator = numberGenerator;
this.itemService = srv;
}
// ...
}
15@agoncal
@Inject on Setters
public class BookBean implements Serializable {
private NumberGenerator numberGenerator;
private ItemService itemService;
@Inject
public void setNumberGenerator(NumberGenerator numGen){
this.numberGenerator = numGen;
}
@Inject
public void setItemService(ItemService itemService) {
this.itemService = itemService;
}
// ...
}
16@agoncal
Activate CDI
● In CDI 1.0 beans.xml in archive
● Since CDI 1.1 it's activated by default
●
All classes having a bean definition annotation
● beans.xml to deactivate or activate all
●
Archive vs Bean archive
Demo
-
@Inject
18@agoncal
Demo: @Inject One Implementation
Qualifiers
20@agoncal
How Do I ?
21@agoncal
How Do I ?
22@agoncal
How Do I ?
@Default
23@agoncal
Use Qualifiers !
@ThirteenDigits
24@agoncal
Use Qualifiers !
@EightDigits
25@agoncal
A Qualifier
@Qualifier
@Retention(RUNTIME)
@Target({ METHOD, FIELD, PARAMETER, TYPE })
@Documented
public @interface ThirteenDigits {
}
26@agoncal
Qualifying an Injection Point
public class BookBean implements Serializable {
@Inject @ThirteenDigits
private NumberGenerator numberGenerator;
@Inject
private ItemService itemService;
// ...
}
27@agoncal
Qualifying an Injection Point
public class BookBean implements Serializable {
@Inject @ThirteenDigits
private NumberGenerator numberGenerator;
@Inject @Default
private ItemService itemService;
// ...
}
28@agoncal
Qualifying a Bean
@ThirteenDigits
public class IsbnGenerator implements NumberGenerator {
@Override
public String generateNumber() {
return "13-" + Math.abs(new Random().nextInt());
}
}
Demo
-
Qualifiers
30@agoncal
Demo: @Inject One Implementation
Producers
32@agoncal
How Do I ?
public class BookBean implements Serializable {
@Inject
private EntityManager em;
@Inject
private Logger logger;
// ...
}
33@agoncal
How Do I ?
public class BookBean implements Serializable {
@Inject
private EntityManager em;
@Inject
private Logger logger;
// ...
}
34@agoncal
How Do I ?
public class BookBean implements Serializable {
@Inject
private EntityManager em;
@Inject
private Logger logger;
// ...
}
Several persistence units
@PersistenceContext(unitName = "myPU1")
@PersistenceContext(unitName = "myPU2")
35@agoncal
How Do I ?
public class BookBean implements Serializable {
@Inject
private EntityManager em;
@Inject
private Logger logger;
// ...
}
Third party framewok
36@agoncal
Use Producers !
public class BookBean implements Serializable {
@Inject
private EntityManager em;
// ...
}
public class ResourceProducer {
@Produces
@PersistenceContext(unitName = "myPU")
private EntityManager entityManager;
}
37@agoncal
Use Producers !
public class BookBean implements Serializable {
@Inject
private Logger logger;
// ...
}
public class ResourceProducer {
@Produces
private Logger produceLogger(InjectionPoint ip) {
return
Logger.getLogger(ip.getMember().getDeclaringClass().getName());
}
}
Demo
-
Producers
39@agoncal
Demo: Producers
Web tier
&
Service tier
41@agoncal
How Do I ?
42@agoncal
How Do I ?
43@agoncal
Use Expression Language...
44@agoncal
Use Expression Language and Scopes !
45@agoncal
Service Tier
@Transactional
public class BookBean implements Serializable {
@Inject
private EntityManager em;
public void update() {
em.persist(book);
}
}
46@agoncal
Service Tier + Web Tier
@Named
@Transactional
public class BookBean implements Serializable {
@Inject
private EntityManager em;
public void update() {
em.persist(book);
}
}
<h:commandLink value="Create"
action='#{bookBean.update}'/>
47@agoncal
Service Tier + Web Tier
@Named("service")
@Transactional
public class BookBean implements Serializable {
@Inject
private EntityManager em;
public void update() {
em.persist(book);
}
}
<h:commandLink value="Create"
action='#{service.update}'/>
48@agoncal
Several scopes
● @Dependent (default)
● @ApplicationScoped, @SessionScoped,
@RequestScoped
● @ConversationScoped
● Create your own
● @TransactionalScoped
● @ViewScoped
● @ThreadScoped
● @ClusterScoped
49@agoncal
Just choose the right scope
@Named
@RequestScoped
@Transactional
public class BookBean implements Serializable {
public void update() {
}
public void delete() {
}
}
50@agoncal
Just choose the right scope
@Named
@SessionScoped
@Transactional
public class BookBean implements Serializable {
public void update() {
}
public void delete() {
}
}
51@agoncal
Just choose the right scope
@Named
@ConversationScoped
@Transactional
public class BookBean implements Serializable {
@Inject
private Conversation conversation;
public void update() {
conversation.begin();
}
public void delete() {
conversation.end();
}
}
Demo
-
@Named & scope
53@agoncal
Demo: @Named & Scope
</>
Alternatives
56@agoncal
How Do I ?
public class MockGenerator implements NumberGenerator {
public String generateNumber() {
return "mock-" + Math.abs(new Random().nextInt());
}
}
57@agoncal
How Do I ?
@Mock
public class MockGenerator implements NumberGenerator {
public String generateNumber() {
return "mock-" + Math.abs(new Random().nextInt());
}
}
public class BookBean implements Serializable {
@Inject @Mock
private NumberGenerator numberGenerator;
// ...
}
58@agoncal
How Do I ?
@Mock
public class MockGenerator implements NumberGenerator {
public String generateNumber() {
return "mock-" + Math.abs(new Random().nextInt());
}
}
public class BookBean implements Serializable {
@Inject @Mock
private NumberGenerator numberGenerator;
// ...
}
59@agoncal
Use an Alternative !
@Alternative
@EightDigits
public class MockGenerator implements NumberGenerator {
public String generateNumber() {
return "mock-" + Math.abs(new Random().nextInt());
}
}
public class BookBean implements Serializable {
@Inject @EightDigits
private NumberGenerator numberGenerator;
// ...
}
60@agoncal
Activate the Alternative
<beans xmlns="http://xmlns.jcp.org/xml/ns/javaee"
...
version="1.1" bean-discovery-mode="all">
<alternatives>
<class>com.foo.MockGenerator</class>
</alternatives>
</beans>
Demo
-
Alternatives
62@agoncal
Demo: Alternatives
Events
64@agoncal
How Do I ?
65@agoncal
How Do I ?
Still too coupled
66@agoncal
Use Events !




67@agoncal
Fire and Observe
public class BookBean implements Serializable {
@Inject
private Event<Book> boughtEvent;
public void update() {
boughtEvent.fire(book);
}
}
public class InventoryService {
private void observeBooks (@Observes Book book) {
logger.info("Book recevied " + book.getTitle());
}
}
68@agoncal
Fire and Observe with Qualifier
public class BookBean implements Serializable {
@Inject @Paper
private Event<Book> boughtEvent;
public void update() {
boughtEvent.fire(book);
}
}
public class InventoryService {
private void observeBooks (@Observes @Paper Book book) {
logger.info("Book recevied " + book.getTitle());
}
}
Demo
-
Events
70@agoncal
Demo: Events
CDI : So Much More
72@agoncal
CDI : So Much More
73@agoncal
CDI Extension ecosystem
74@agoncal
CDI Course on PluralSight
http://www.pluralsight.com/courses/context-dependency-injection-1-1
Thanks
www.antoniogoncalves.org
antonio.goncalves@gmail.com
@agoncal
@devoxxfr
@lescastcodeurs
Q & A
77@agoncal
Creative Commons
● Attribution — You must attribute the work in
the manner specified by the author or licensor
(but not in any way that suggests that they
endorse you or your use of the work).
● Noncommercial — You may not use this work for
commercial purposes.
● Share Alike — If you alter, transform, or build
upon this work, you may distribute the resulting
work only under the same or similar license to
this one.
CDI : How do I ?
by antonio goncalves
@agoncal
2@agoncal
Antonio Goncalves
What is CDI ?
4@agoncal
What is CDI ?
●
Dependency injection
● Lose coupling, strong typing
●
Context management
●
Interceptors and decorators
● Event bus
●
Extensions
5@agoncal
History of CDI
6@agoncal
Implementations
Demo
-
Creating a Web App
8@agoncal
Demos with JBoss Forge
●
Java EE scaffolding tool
● Shell commands
●
CRUD application
●
Gets you start quickly
● Takes care of integration
●
Plugin based
9@agoncal
Demo: Creating a Web App
Dependency Injection
11@agoncal
How Do I ?
12@agoncal
Use @Inject !
13@agoncal
@Inject on Attributes
public class BookBean implements Serializable {
@Inject
private NumberGenerator numberGenerator;
@Inject
private ItemService itemService;
// ...
}
14@agoncal
@Inject on Constructor
public class BookBean implements Serializable {
private NumberGenerator numberGenerator;
private ItemService itemService;
@Inject
public BookBean(NumberGenerator numberGenerator,
ItemService srv){
this.numberGenerator = numberGenerator;
this.itemService = srv;
}
// ...
}
15@agoncal
@Inject on Setters
public class BookBean implements Serializable {
private NumberGenerator numberGenerator;
private ItemService itemService;
@Inject
public void setNumberGenerator(NumberGenerator numGen){
this.numberGenerator = numGen;
}
@Inject
public void setItemService(ItemService itemService) {
this.itemService = itemService;
}
// ...
}
16@agoncal
Activate CDI
● In CDI 1.0 beans.xml in archive
● Since CDI 1.1 it's activated by default
●
All classes having a bean definition annotation
● beans.xml to deactivate or activate all
●
Archive vs Bean archive
Demo
-
@Inject
18@agoncal
Demo: @Inject One Implementation
Qualifiers
20@agoncal
How Do I ?
21@agoncal
How Do I ?
22@agoncal
How Do I ?
@Default
23@agoncal
Use Qualifiers !
@ThirteenDigits
24@agoncal
Use Qualifiers !
@EightDigits
25@agoncal
A Qualifier
@Qualifier
@Retention(RUNTIME)
@Target({ METHOD, FIELD, PARAMETER, TYPE })
@Documented
public @interface ThirteenDigits {
}
26@agoncal
Qualifying an Injection Point
public class BookBean implements Serializable {
@Inject @ThirteenDigits
private NumberGenerator numberGenerator;
@Inject
private ItemService itemService;
// ...
}
27@agoncal
Qualifying an Injection Point
public class BookBean implements Serializable {
@Inject @ThirteenDigits
private NumberGenerator numberGenerator;
@Inject @Default
private ItemService itemService;
// ...
}
28@agoncal
Qualifying a Bean
@ThirteenDigits
public class IsbnGenerator implements NumberGenerator {
@Override
public String generateNumber() {
return "13-" + Math.abs(new Random().nextInt());
}
}
Demo
-
Qualifiers
30@agoncal
Demo: @Inject One Implementation
Producers
32@agoncal
How Do I ?
public class BookBean implements Serializable {
@Inject
private EntityManager em;
@Inject
private Logger logger;
// ...
}
33@agoncal
How Do I ?
public class BookBean implements Serializable {
@Inject
private EntityManager em;
@Inject
private Logger logger;
// ...
}
34@agoncal
How Do I ?
public class BookBean implements Serializable {
@Inject
private EntityManager em;
@Inject
private Logger logger;
// ...
}
Several persistence units
@PersistenceContext(unitName = "myPU1")
@PersistenceContext(unitName = "myPU2")
35@agoncal
How Do I ?
public class BookBean implements Serializable {
@Inject
private EntityManager em;
@Inject
private Logger logger;
// ...
}
Third party framewok
36@agoncal
Use Producers !
public class BookBean implements Serializable {
@Inject
private EntityManager em;
// ...
}
public class ResourceProducer {
@Produces
@PersistenceContext(unitName = "myPU")
private EntityManager entityManager;
}
37@agoncal
Use Producers !
public class BookBean implements Serializable {
@Inject
private Logger logger;
// ...
}
public class ResourceProducer {
@Produces
private Logger produceLogger(InjectionPoint ip) {
return
Logger.getLogger(ip.getMember().getDeclaringClass().getName());
}
}
Demo
-
Producers
39@agoncal
Demo: Producers
Web tier
&
Service tier
41@agoncal
How Do I ?
42@agoncal
How Do I ?
43@agoncal
Use Expression Language...
44@agoncal
Use Expression Language and Scopes !
45@agoncal
Service Tier
@Transactional
public class BookBean implements Serializable {
@Inject
private EntityManager em;
public void update() {
em.persist(book);
}
}
46@agoncal
Service Tier + Web Tier
@Named
@Transactional
public class BookBean implements Serializable {
@Inject
private EntityManager em;
public void update() {
em.persist(book);
}
}
<h:commandLink value="Create"
action='#{bookBean.update}'/>
47@agoncal
Service Tier + Web Tier
@Named("service")
@Transactional
public class BookBean implements Serializable {
@Inject
private EntityManager em;
public void update() {
em.persist(book);
}
}
<h:commandLink value="Create"
action='#{service.update}'/>
48@agoncal
Several scopes
● @Dependent (default)
● @ApplicationScoped, @SessionScoped,
@RequestScoped
● @ConversationScoped
● Create your own
● @TransactionalScoped
● @ViewScoped
● @ThreadScoped
● @ClusterScoped
49@agoncal
Just choose the right scope
@Named
@RequestScoped
@Transactional
public class BookBean implements Serializable {
public void update() {
}
public void delete() {
}
}
50@agoncal
Just choose the right scope
@Named
@SessionScoped
@Transactional
public class BookBean implements Serializable {
public void update() {
}
public void delete() {
}
}
51@agoncal
Just choose the right scope
@Named
@ConversationScoped
@Transactional
public class BookBean implements Serializable {
@Inject
private Conversation conversation;
public void update() {
conversation.begin();
}
public void delete() {
conversation.end();
}
}
Demo
-
@Named & scope
53@agoncal
Demo: @Named & Scope
</>
Alternatives
56@agoncal
How Do I ?
public class MockGenerator implements NumberGenerator {
public String generateNumber() {
return "mock-" + Math.abs(new Random().nextInt());
}
}
57@agoncal
How Do I ?
@Mock
public class MockGenerator implements NumberGenerator {
public String generateNumber() {
return "mock-" + Math.abs(new Random().nextInt());
}
}
public class BookBean implements Serializable {
@Inject @Mock
private NumberGenerator numberGenerator;
// ...
}
58@agoncal
How Do I ?
@Mock
public class MockGenerator implements NumberGenerator {
public String generateNumber() {
return "mock-" + Math.abs(new Random().nextInt());
}
}
public class BookBean implements Serializable {
@Inject @Mock
private NumberGenerator numberGenerator;
// ...
}
59@agoncal
Use an Alternative !
@Alternative
@EightDigits
public class MockGenerator implements NumberGenerator {
public String generateNumber() {
return "mock-" + Math.abs(new Random().nextInt());
}
}
public class BookBean implements Serializable {
@Inject @EightDigits
private NumberGenerator numberGenerator;
// ...
}
60@agoncal
Activate the Alternative
<beans xmlns="http://xmlns.jcp.org/xml/ns/javaee"
...
version="1.1" bean-discovery-mode="all">
<alternatives>
<class>com.foo.MockGenerator</class>
</alternatives>
</beans>
Demo
-
Alternatives
62@agoncal
Demo: Alternatives
Events
64@agoncal
How Do I ?
65@agoncal
How Do I ?
Still too coupled
66@agoncal
Use Events !




67@agoncal
Fire and Observe
public class BookBean implements Serializable {
@Inject
private Event<Book> boughtEvent;
public void update() {
boughtEvent.fire(book);
}
}
public class InventoryService {
private void observeBooks (@Observes Book book) {
logger.info("Book recevied " + book.getTitle());
}
}
68@agoncal
Fire and Observe with Qualifier
public class BookBean implements Serializable {
@Inject @Paper
private Event<Book> boughtEvent;
public void update() {
boughtEvent.fire(book);
}
}
public class InventoryService {
private void observeBooks (@Observes @Paper Book book) {
logger.info("Book recevied " + book.getTitle());
}
}
Demo
-
Events
70@agoncal
Demo: Events
CDI : So Much More
72@agoncal
CDI : So Much More
73@agoncal
CDI Extension ecosystem
74@agoncal
CDI Course on PluralSight
http://www.pluralsight.com/courses/context-dependency-injection-1-1
Thanks
www.antoniogoncalves.org
antonio.goncalves@gmail.com
@agoncal
@devoxxfr
@lescastcodeurs
Q & A
77@agoncal
Creative Commons
● Attribution — You must attribute the work in
the manner specified by the author or licensor
(but not in any way that suggests that they
endorse you or your use of the work).
●
Noncommercial — You may not use this work for
commercial purposes.
● Share Alike — If you alter, transform, or build
upon this work, you may distribute the resulting
work only under the same or similar license to
this one.

Mais conteúdo relacionado

Mais procurados

Javaslang Talk @ Javaland 2017
Javaslang Talk @ Javaland 2017Javaslang Talk @ Javaland 2017
Javaslang Talk @ Javaland 2017David Schmitz
 
Why Spring <3 Kotlin
Why Spring <3 KotlinWhy Spring <3 Kotlin
Why Spring <3 KotlinVMware Tanzu
 
Паразитируем на React-экосистеме (Angular 4+) / Алексей Охрименко (IPONWEB)
Паразитируем на React-экосистеме (Angular 4+) / Алексей Охрименко (IPONWEB)Паразитируем на React-экосистеме (Angular 4+) / Алексей Охрименко (IPONWEB)
Паразитируем на React-экосистеме (Angular 4+) / Алексей Охрименко (IPONWEB)Ontico
 
Daggerate your code - Write your own annotation processor
Daggerate your code - Write your own annotation processorDaggerate your code - Write your own annotation processor
Daggerate your code - Write your own annotation processorBartosz Kosarzycki
 
Quickly Testing Qt Desktop Applications
Quickly Testing Qt Desktop ApplicationsQuickly Testing Qt Desktop Applications
Quickly Testing Qt Desktop ApplicationsClare Macrae
 
Come and Play! with Java EE 7
Come and Play! with Java EE 7Come and Play! with Java EE 7
Come and Play! with Java EE 7Antonio Goncalves
 
Dagger 2. The Right Way to Dependency Injections
Dagger 2. The Right Way to Dependency InjectionsDagger 2. The Right Way to Dependency Injections
Dagger 2. The Right Way to Dependency InjectionsGlobalLogic Ukraine
 
Dagger 2. Right way to do Dependency Injection
Dagger 2. Right way to do Dependency InjectionDagger 2. Right way to do Dependency Injection
Dagger 2. Right way to do Dependency InjectionStfalcon Meetups
 
Reactive Programming with JavaScript
Reactive Programming with JavaScriptReactive Programming with JavaScript
Reactive Programming with JavaScriptCodemotion
 
Using hilt in a modularized project
Using hilt in a modularized projectUsing hilt in a modularized project
Using hilt in a modularized projectFabio Collini
 
A friend in need - A JS indeed
A friend in need - A JS indeedA friend in need - A JS indeed
A friend in need - A JS indeedYonatan Levin
 
CDI do básico ao avançado
CDI do básico ao avançadoCDI do básico ao avançado
CDI do básico ao avançadoAlberto Souza
 
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 2014Antoine Sabot-Durand
 
Testing Java Code Effectively
Testing Java Code EffectivelyTesting Java Code Effectively
Testing Java Code EffectivelyAndres Almiray
 
RSpec 3.0: Under the Covers
RSpec 3.0: Under the CoversRSpec 3.0: Under the Covers
RSpec 3.0: Under the CoversBrian Gesiak
 

Mais procurados (20)

Javaslang @ Devoxx
Javaslang @ DevoxxJavaslang @ Devoxx
Javaslang @ Devoxx
 
Javaslang Talk @ Javaland 2017
Javaslang Talk @ Javaland 2017Javaslang Talk @ Javaland 2017
Javaslang Talk @ Javaland 2017
 
Why Spring <3 Kotlin
Why Spring <3 KotlinWhy Spring <3 Kotlin
Why Spring <3 Kotlin
 
Паразитируем на React-экосистеме (Angular 4+) / Алексей Охрименко (IPONWEB)
Паразитируем на React-экосистеме (Angular 4+) / Алексей Охрименко (IPONWEB)Паразитируем на React-экосистеме (Angular 4+) / Алексей Охрименко (IPONWEB)
Паразитируем на React-экосистеме (Angular 4+) / Алексей Охрименко (IPONWEB)
 
Daggerate your code - Write your own annotation processor
Daggerate your code - Write your own annotation processorDaggerate your code - Write your own annotation processor
Daggerate your code - Write your own annotation processor
 
Quickly Testing Qt Desktop Applications
Quickly Testing Qt Desktop ApplicationsQuickly Testing Qt Desktop Applications
Quickly Testing Qt Desktop Applications
 
Come and Play! with Java EE 7
Come and Play! with Java EE 7Come and Play! with Java EE 7
Come and Play! with Java EE 7
 
Dagger 2. The Right Way to Dependency Injections
Dagger 2. The Right Way to Dependency InjectionsDagger 2. The Right Way to Dependency Injections
Dagger 2. The Right Way to Dependency Injections
 
Dagger 2. Right way to do Dependency Injection
Dagger 2. Right way to do Dependency InjectionDagger 2. Right way to do Dependency Injection
Dagger 2. Right way to do Dependency Injection
 
Reactive Programming with JavaScript
Reactive Programming with JavaScriptReactive Programming with JavaScript
Reactive Programming with JavaScript
 
Open sourcing the store
Open sourcing the storeOpen sourcing the store
Open sourcing the store
 
Angular2 + rxjs
Angular2 + rxjsAngular2 + rxjs
Angular2 + rxjs
 
Using hilt in a modularized project
Using hilt in a modularized projectUsing hilt in a modularized project
Using hilt in a modularized project
 
A friend in need - A JS indeed
A friend in need - A JS indeedA friend in need - A JS indeed
A friend in need - A JS indeed
 
CDI do básico ao avançado
CDI do básico ao avançadoCDI do básico ao avançado
CDI do básico ao avançado
 
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
 
Testing Java Code Effectively
Testing Java Code EffectivelyTesting Java Code Effectively
Testing Java Code Effectively
 
RSpec 3.0: Under the Covers
RSpec 3.0: Under the CoversRSpec 3.0: Under the Covers
RSpec 3.0: Under the Covers
 
Vue next
Vue nextVue next
Vue next
 
Unit Testing in Kotlin
Unit Testing in KotlinUnit Testing in Kotlin
Unit Testing in Kotlin
 

Semelhante a CDI: How do I ?

Breaking Dependencies Legacy Code - Cork Software Crafters - September 2019
Breaking Dependencies Legacy Code -  Cork Software Crafters - September 2019Breaking Dependencies Legacy Code -  Cork Software Crafters - September 2019
Breaking Dependencies Legacy Code - Cork Software Crafters - September 2019Paulo Clavijo
 
Using and contributing to the next Guice
Using and contributing to the next GuiceUsing and contributing to the next Guice
Using and contributing to the next GuiceAdrian Cole
 
Java onguice20070426
Java onguice20070426Java onguice20070426
Java onguice20070426Ratul Ray
 
Java EE changes design pattern implementation: JavaDays Kiev 2015
Java EE changes design pattern implementation: JavaDays Kiev 2015Java EE changes design pattern implementation: JavaDays Kiev 2015
Java EE changes design pattern implementation: JavaDays Kiev 2015Alex Theedom
 
Factory method pattern (Virtual Constructor)
Factory method pattern (Virtual Constructor)Factory method pattern (Virtual Constructor)
Factory method pattern (Virtual Constructor)Sameer Rathoud
 
Web technologies-course 12.pptx
Web technologies-course 12.pptxWeb technologies-course 12.pptx
Web technologies-course 12.pptxStefan Oprea
 
Bring the fun back to java
Bring the fun back to javaBring the fun back to java
Bring the fun back to javaciklum_ods
 
Microservices Chaos Testing at Jet
Microservices Chaos Testing at JetMicroservices Chaos Testing at Jet
Microservices Chaos Testing at JetC4Media
 
Context and Dependency Injection
Context and Dependency InjectionContext and Dependency Injection
Context and Dependency InjectionWerner Keil
 
The Basic Concept Of IOC
The Basic Concept Of IOCThe Basic Concept Of IOC
The Basic Concept Of IOCCarl Lu
 
Test Driven Development with JavaFX
Test Driven Development with JavaFXTest Driven Development with JavaFX
Test Driven Development with JavaFXHendrik Ebbers
 
Dependency injection using dagger2
Dependency injection using dagger2Dependency injection using dagger2
Dependency injection using dagger2Javad Hashemi
 
Arquillian Constellation
Arquillian ConstellationArquillian Constellation
Arquillian ConstellationAlex Soto
 
Building maintainable app #droidconzg
Building maintainable app #droidconzgBuilding maintainable app #droidconzg
Building maintainable app #droidconzgKristijan Jurković
 
Writing testable Android apps
Writing testable Android appsWriting testable Android apps
Writing testable Android appsTomáš Kypta
 
PVS-Studio in the Clouds: Azure DevOps
PVS-Studio in the Clouds: Azure DevOpsPVS-Studio in the Clouds: Azure DevOps
PVS-Studio in the Clouds: Azure DevOpsAndrey Karpov
 

Semelhante a CDI: How do I ? (20)

Breaking Dependencies Legacy Code - Cork Software Crafters - September 2019
Breaking Dependencies Legacy Code -  Cork Software Crafters - September 2019Breaking Dependencies Legacy Code -  Cork Software Crafters - September 2019
Breaking Dependencies Legacy Code - Cork Software Crafters - September 2019
 
Using and contributing to the next Guice
Using and contributing to the next GuiceUsing and contributing to the next Guice
Using and contributing to the next Guice
 
Java onguice20070426
Java onguice20070426Java onguice20070426
Java onguice20070426
 
S313937 cdi dochez
S313937 cdi dochezS313937 cdi dochez
S313937 cdi dochez
 
Java EE changes design pattern implementation: JavaDays Kiev 2015
Java EE changes design pattern implementation: JavaDays Kiev 2015Java EE changes design pattern implementation: JavaDays Kiev 2015
Java EE changes design pattern implementation: JavaDays Kiev 2015
 
Factory method pattern (Virtual Constructor)
Factory method pattern (Virtual Constructor)Factory method pattern (Virtual Constructor)
Factory method pattern (Virtual Constructor)
 
Web technologies-course 12.pptx
Web technologies-course 12.pptxWeb technologies-course 12.pptx
Web technologies-course 12.pptx
 
Bring the fun back to java
Bring the fun back to javaBring the fun back to java
Bring the fun back to java
 
Microservices Chaos Testing at Jet
Microservices Chaos Testing at JetMicroservices Chaos Testing at Jet
Microservices Chaos Testing at Jet
 
Context and Dependency Injection
Context and Dependency InjectionContext and Dependency Injection
Context and Dependency Injection
 
The Basic Concept Of IOC
The Basic Concept Of IOCThe Basic Concept Of IOC
The Basic Concept Of IOC
 
Test Driven Development with JavaFX
Test Driven Development with JavaFXTest Driven Development with JavaFX
Test Driven Development with JavaFX
 
Dependency injection using dagger2
Dependency injection using dagger2Dependency injection using dagger2
Dependency injection using dagger2
 
Software Design Patterns
Software Design PatternsSoftware Design Patterns
Software Design Patterns
 
Arquillian Constellation
Arquillian ConstellationArquillian Constellation
Arquillian Constellation
 
jDays Sweden 2016
jDays Sweden 2016jDays Sweden 2016
jDays Sweden 2016
 
Building maintainable app #droidconzg
Building maintainable app #droidconzgBuilding maintainable app #droidconzg
Building maintainable app #droidconzg
 
Writing testable Android apps
Writing testable Android appsWriting testable Android apps
Writing testable Android apps
 
PVS-Studio in the Clouds: Azure DevOps
PVS-Studio in the Clouds: Azure DevOpsPVS-Studio in the Clouds: Azure DevOps
PVS-Studio in the Clouds: Azure DevOps
 
Need 4 Speed FI
Need 4 Speed FINeed 4 Speed FI
Need 4 Speed FI
 

Último

Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureDinusha Kumarasiri
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesŁukasz Chruściel
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 
Introduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfIntroduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfFerryKemperman
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Andreas Granig
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...Christina Lin
 
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company OdishaBalasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odishasmiwainfosol
 
Buds n Tech IT Solutions: Top-Notch Web Services in Noida
Buds n Tech IT Solutions: Top-Notch Web Services in NoidaBuds n Tech IT Solutions: Top-Notch Web Services in Noida
Buds n Tech IT Solutions: Top-Notch Web Services in Noidabntitsolutionsrishis
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWave PLM
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtimeandrehoraa
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaHanief Utama
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmSujith Sukumaran
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsAhmed Mohamed
 
What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....kzayra69
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...OnePlan Solutions
 
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)jennyeacort
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxTier1 app
 

Último (20)

Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with Azure
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New Features
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 
Introduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfIntroduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdf
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
 
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company OdishaBalasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
 
Buds n Tech IT Solutions: Top-Notch Web Services in Noida
Buds n Tech IT Solutions: Top-Notch Web Services in NoidaBuds n Tech IT Solutions: Top-Notch Web Services in Noida
Buds n Tech IT Solutions: Top-Notch Web Services in Noida
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need It
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtime
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief Utama
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalm
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML Diagrams
 
What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
 
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
 

CDI: How do I ?