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!

This entry was posted in Spring and tagged , . Bookmark the permalink.

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

  1. Hi tibo,
    On the referred quote…
    “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.”

    I really-really want to believe it… But, first I would like to see some showcases/live demos. I am not expecting a regurgitation of the petstore again. I am expecting showcases handling hundred of thousand of records with acceptable performance. Showcases on Java mobile, showcases in social networking, showcases on NOSQL, etc.

    I know they are going to ask me to show my showcases. That’s fair, my Spring Framework 3.* showcases are located at http://pragmatikroo.blogspot.com. It includes 2 live demos and some video tutorials as well.
    While I don’t see acceptable showcases about JEE 6 I will consider it as just “wishful thinking”

    Thank you
    jD

  2. @jD Indeed I miss the PetStore too…
    I have heard about a specification saying that all new specifications will required to have a sample project. I don’t know if it was just a dream but I can’t find anything on the web talking about that.
    Antonio Goncalves has made a nice PetStore for Java EE 6 on github : https://github.com/agoncal/agoncal-application-petstore-ee6. I really love Antonio’s work, it is one of my Java guru ;)
    For Spring, the most up to date sample application is their Spring-travel, available their : https://src.springframework.org/svn/spring-samples/travel/

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>