Java EE 6 VS Spring 3 : Java EE has killed Spring? No way!

Introduction

Few days ago, I was listening to the epsiode 85 of the Java Spotlight Podcast. In this epsiode, Bert Ertman and Paul Bakker were talking about migrating from Spring to Java EE. Basically, in their introduction they were saying that, nowaday, there is no point choosing Spring over Java EE. We can read in their article :

It took a while but Java EE has finally made the leap to be a standard, lightweight, fitting solutions to the vast majority of real-world development challenges in the mainstream enterprise applications space. You should have no single reason beyond choosing the standard.

Over the last couple of months, I have seen a lot of blog articles with similar thoughts. Some are praisising Java EE, which is a good thing, while others are just denigrating Spring. This is the case of the article of Arun Gupta. My first thought on this article was “Oracle might be really desperate to write such trolls…”.

I am not at all a Spring evangelist nor a Java EE hater. At the contrary, I have used intensively Java EE 5 for 2 years and am really happy to see that Java EE finally became a good competitor for Spring. My goal is not to praise Spring here, just to balance the words of the “Spring’s hater”.

Standard VS Single vendor solution

Is that good to have standards?

Do you know this sentence “Responding to change over following a plan”? Yes, it is one the Agile rules. Of course it is a good thing to have standards, it is more than good, it is fundamental! But it comes with its drawbacks. If one day you have a problem with the standard, something not covered by the standard, your only solution is to fill an issue, cross your finger and wait 3 years…

Are Spring and standards incompatible?

Not at all! That is one of the reason I do not understand the “It is standard” argument. Spring does its best to provide the use of the standard. You are free to use JPA, the CDI annotation etc. I consider Spring more like an integration platform that let you use all Java EE technologies and also some additional features provided by Spring itself.

Do I depend on SpringSource? Not really…

What happen if tomorrow SpringSource stop developing Spring? I will continue using it… Spring Framework is under Apache 2.0 license, no doubt that the community will take the relay and that some new companies will offer support for Spring. Even if nobody do that, I am happy with Spring Framework in its current state, why would I change? Maybe I will reconsider it in 3 years, when a new version of Java EE will be released…

What happen if tomorrow I am not happy with Spring Framework? The same thing than if I am not happy with Java EE… I stop using it…

What happen if tomorrow I am not happy with my application server? The same thing than if I am not happy with Java EE… I change it… Except that, with Spring, I will have more choices (since Spring works with all Java EE application server + the others like tomcat, jetty etc…).

Spring has always been innovative and will always be

I will never forget that Spring has made CDI possible and easy for the Java web development. Java EE has followed (again 3 years later…) with the JSR-299.

Spring is also currently providing some awesome solutions not provided at all by JavaEE:

  • Spring Data (Really nice especially for the NoSQL world)
  • Spring Social (Woops… JSR-357 has recently been rejected…)
  • Spring Mobile

Some of them are in the plan of the next versions of Java EE (yay, we will have it in 3 years!) while others have still not been taken into consideration or have been rejected.

Integration Testing

One of the common argument for Java is that you don’t have to use mocks, you can do in-container testing thanks to Arquillian. I am definitely in favor of in-container testing instead of mocks and Arquillian is a great tool. Anyway, Arquillian is nice for Java EE but it is not Java EE! There is no standards for that and so you depend on a single vendor, JBoss (redhat), which makes the “It is standard” argument pointless. Then it is not impossible to test spring with Arquillian… At least, even if it is not perfect, Spring has the merit to provide something by its own…

Conclusion

I have not focused my article on the enhancement provided by the Java EE platform nor on the different features implemented by each, that was not my goal. I still believe that Java EE is a really good product and that it has finally become a serious competitor. But when I read “While Spring was revolutionary in its time [...], it really is last generation’s framework – some people are even calling it legacy” that really annoys me. How can we say that?! Maybe just to do a buzz… and it works!

Reference: Java EE 6 VS Spring 3 : Java EE has killed Spring? No way! from our JCG partner Tibo Delor at the InvalidCodeException blog.

Do you want to know how to develop your skillset to become a Java Rockstar?

Subscribe to our newsletter to start Rocking right now!

To get you started we give you two of our best selling eBooks for FREE!

JPA Mini Book

Learn how to leverage the power of JPA in order to create robust and flexible Java applications. With this Mini Book, you will get introduced to JPA and smoothly transition to more advanced concepts.

JVM Troubleshooting Guide

The Java virtual machine is really the foundation of any Java EE platform. Learn how to master it with this advanced guide!

Given email address is already subscribed, thank you!
Oops. Something went wrong. Please try again later.
Please provide a valid email address.
Thank you, your sign-up request was successful! Please check your e-mail inbox.
Please complete the CAPTCHA.
Please fill in the required fields.

2 Responses to "Java EE 6 VS Spring 3 : Java EE has killed Spring? No way!"

  1. Baker Kawesa says:

    Ever wonder why anyone uses Java instead of PHP, Ruby, Python, or something else? Predictability! Java is quite a snob, it’s all about standards this and standards that. If you spend a fortune developing an app using Spring or Java EE, the last thing you want is for things to just change. We all know what happens when specs are rushed – xml hell and now annotation hell! Agility is nice but stability is even nicer!

  2. Sachin says:

    Tibo, Thanks for a wonderful article providing a balanced view. I don’t see why JEE 6 means Spring is legacy or redundant now…

Leave a Reply


− four = 5



Java Code Geeks and all content copyright © 2010-2014, Exelixis Media Ltd | Terms of Use | Privacy Policy | Contact
All trademarks and registered trademarks appearing on Java Code Geeks are the property of their respective owners.
Java is a trademark or registered trademark of Oracle Corporation in the United States and other countries.
Java Code Geeks is not connected to Oracle Corporation and is not sponsored by Oracle Corporation.
Do you want to know how to develop your skillset and become a ...
Java Rockstar?

Subscribe to our newsletter to start Rocking right now!

To get you started we give you two of our best selling eBooks for FREE!

Get ready to Rock!
You can download the complementary eBooks using the links below:
Close