Adam Bien's Weblog

"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.
Posted at 01:09PM Sep 29, 2010 by Adam Bien,
Comments[8]
| Views/Hits: 937
NEW workshop: Building HTML 5 Applications Without Frameworks,
Full week in December 2016: from Java EE 7 Bootstrap, Effective, Architectures over Testing to Microservices
On demand workshops: Java EE 7: Bootstrap, Effective, Testing and Microservices available for streaming.

- WebSphere beta comes with Java EE 6 support already
- Resin does support Java EE 6 WebProfile - there are in the certification process (but it works already pretty good)
- JBoss 6m5 does support WebProfile as well.
- WebLogic will support Java EE 6 next year.
- you should watch tomcat as well...

For greenfield this shouldn't be an issue.
For Spring DI there is only one big player - Spring :-).

Surely with Java EE 6, there is really no point of considering Spring for greenfield projects.

If there is already a standardised platform, it's much better to simply use it.

Additionally, Java EE 6 is the result of collaborations between various organisations. They innovate/evolve the platform taking aspects such as backward compatibility and ease-of-migration in mind. By adopting standards, Java EE applications will actually gain benefits.

With Java EE (in general) and Spring, the rule-of-thumb perhaps could be, "If there is no way to achieve X in Java EE, only THEN consider options provided by Spring/Others"

From an in the trenches approach we are using technologies forced upon us by external constraints. We are going to refactor soon and considering JBoss 6.x. Support is first and foremost on my mind. We are developing a product and doing a long term investment. I do agree that most 'contract' developers do not care about support. Enough of my rant.. :)

Moving to JEE 6 seems early as only now are major vendors STARTING to support it. With vendors only starting, technical resources with the skill set are going to be difficult to find and expensive.

JEE 6 'looks cool' to me, but think it is still the prototype car at the car show, at least 2 years from mass production.

I can't believe no one commented on calling Glassfish a "niche" server. Really? This is like FUD because someone wants to stick up for Spring. Glassfish is an AMAZING server and has been since its v1 release. I have found 3.0.1 to be the best release yet (I don't use session clustering - but a load balancer with sticky bits). A lot of the Java EE 6 stuff is based on the tried and true Java EE 5 stuff so its not even that much of a learner curve.

If you don't know about how good the Java EE 6 stuff is you owe it to yourself to download Netbeans 6.9.1 with glassfish and go through some tutorials.

I do not doubt that Tomcat is a good server but I want to use plain old com.sun.httpserver (http://download.oracle.com/javase/6/docs/jre/api/net/httpserver/spec/com/sun/net/httpserver/package-summary.html) for deploying Java web apps :-).