I was collecting some opinions on when to choose Java EE over Spring (or vice versa). I know that one doesn’t have to choose, but I still believe most of the time only one of them (and not both) will become a core part of your architecture.
Here’s my preliminary list of resources:
- Make the Right Decision with Our Side-by-Side Comparison of Spring and EJB 3.0, Rod Coffin
- Spring and EJB Compared, Floyd Marinescu; discusses this article
- POJO Application Frameworks: Spring Vs. EJB 3.0, Michael Juntao Yuan (JBoss), notable comments here and here
I used the Spring IoC container once, and was very happy with it. I used EJB 2.x, and it sucked (but not as much as many claim), and EJB 3 is a vast improvement. I’m not leaning towards one or the other. At the moment, I see these main differences:
- Spring is “just” a very well established open source project (with a huge community); Java EE/EJB 3 is “just” a standard supported by commercial and open source products
- Spring relies heavily on XML configuration (yuck!) while Java EE/EJB 3 relies on annotations (phew!)
- Spring can be stripped to its bare bones (cool!), with Java EE/EJB 3 you always get the whole “integrated” package (great!)
Any pointers to things I’m obviously missing?
If you are comparing Spring to EJB 3, you really should take a look at the JBoss Seam framework. The latest version also provides Spring integration. http://jboss.com/products/seam
Yes, I do work for JBoss.
Kevin