adam bien's blog

Java EE 6 (CDI / EJB 3.1) XOR Spring Core Reloaded 📎

"Java EE 6 or Spring?" The question was asked during our JavaOne Java EE 6 Panel and the attendees expected a clear answer.

There is no need to switch from one to another in already running projects. In greenfield projects (=where you are beginning from scratch) however, you have to make a clear distinction for the core part. Between Java EE 5/6 (not J2EE) and Spring, there is too much overlap in the core Dependency Injection part - "JSR-330 Dependency Injection For Java" is supported by both platforms. There is no added value to run the Spring core part (Dependency Injection) on top of the Java EE 6. There is also no added value to run CDI on top of the Spring framework.
Spring tools and utilities like e.g. JMS Template can be still used and combined with Java EE 6. This decision for the introduction of complimentary tools (JMS template, JDBC template etc.) can be postponed and such a utility introduced on demand.
The last Java EE 6 XOR Spring post covered the support part - which is also important to communicate to your clients (developers usually do not care about the support questions :-)) and may influence the decision.