If you want to learn about CDI you can read the 4 articles I wrote in the Java Magazine : Part I : Using strong typing in dependency injection (May/June 2015). This article covers basic dependency injection with CDI, @Inject, Qualifiers and Alternatives. Part II : Integrating third-party frameworks. Covers Producers, InjectionPoint API and Diposers Part III : Loose coupling. This […]
I’m happy to announce that my course on CDI 1.1 has been published on PluralSight. This 3:40 hours long course is divided in several modules : Introduction (17:48) : Why do we need dependency injection in our applications, how do we usually do it, how can CDI help us Understanding Context and Dependency Injection (20:24) : Get the basis of […]
Here we are, using H2 in our test environment, Derby in development and Postgres in production. It’s 2014, and Java EE still doesn’t have a decent configuration specification… So how do we change datasources in Java EE depending on our environment ? There are several possibilities (from external property files, Maven resource filtering, Maven profiles with different configuration or JNDI tricks) but this […]
Here is my contribution on Java EE 7 courses :
- Bean Validation 1.1 (2:30 hours long)
- Built-in Constraints
- Defining our own Constraints
- Messages, Groups and Payloads
- Advanced Topics
- Java Persistence API 2.1 (3:41 hours long)
- Managing Elementary Entities With JPA
- Relationships and Inheritance
- Querying Entities
- Entity Lifecycle, Callbacks, and Listeners
- Context & Dependency Injection 1.1 (3:42 hours long)
- Injection With CDI
- Producers and Disposers
- Interceptors, Decorators, and Events
- Bringing the Web Tier and Service Tier Together
Each course is made of slides, demos and you will have the pleasure to listen to my voice ;o) No video of the speaker, but many screen recording for the demos. Each course is made of several modules, several clips, and you get to answer a few questions at the end of each module
So I hope you will enjoy taking the courses (not free I'm afraid ;o) and do not hesitate to give me some feedback.
It's 2012 and my first resolution of the year is to finally tell the truth about testing : unit testing is pretty much useless when your code runs inside a container. How do you unit test an EJB which relies on the container services (i.e transaction, injection, security...) ? Well, you mock the database access, you mock your security layer, you mock your dependencies, you mock your validation layer... to test what ? A bit of business logic. Yes. Unit test is interesting when you have complex business logic to test so you can have quick feedback. Otherwise, it's a waste of time which doesn't test your container services. So I'm not saying unit testing is completely useless, I'm saying that integration testing is also to be considered when you run your code inside a Java EE container.
If you follow this blog you should know that latelly I've been writing (and talking) about CDI (Contexts and Dependency Injection). CDI has many aspects to it but until now I've focused on how to boostrap CDI in several environments, how to add CDI to an existing Java EE 6 application, and more recently how to use injection with CDI. Actually this post is the third on CDI Injection : Part I focused on default injection and qualifiers, and Part II on all the possible injection points (field, constructor and setters). In this post I'll explain producers or "how you can inject anything anywhere in a type safe manner".
Two weeks ago I did a little tour around several JUGs and conferences to talk about dependency injections with CDI. The final goal of this road movie was to end up at GeeCon in Krakow. It was my second time at GeeCon and I have to say that this conference is like good wine : getting better with age. This community based conference is on its third edition and attracts people through out central and eastern Europe. Plenty of good speakers, nice location, skilled attendees... and a lot of fun (GeeCon organizers are party addicts). So make sure you mark this conference into your agenda for next year....