Why I will use Java EE instead of Spring in new Enterprise Java Projects in 2012

Home

News: Why I will use Java EE instead of Spring in new Enterprise Java Projects in 2012

  1. The question comes up often. It came up in my new project in November 2011, too. I will use Java EE (JEE) instead of the Spring framework in this new Enterprise Java project.

    I know: Several articles, blogs and forum discussions are available regarding this topic. Why is there a need for one more? Because many blogs talk about older versions of Java EE or because they are not neutral (I hope to be neutral). And because many people still think thank EJBs are heavy! And because the time has changed: It is Java EE 6 time now, J2EE is dead. Finally! Finally, because not only JEE 6 is available, but also several application servers (not just Glassfish as reference implementation). I do not want to start a flame war (too many exist already), I just want to describe my personal opinion of the JEE vs. Spring „fight“…

    Therefore, I think it is very important to start with a short overview and history of both alternatives. Afterwards, I will list the differences of both and explain why these differences lead me to JEE instead of Spring for most new Java projects. I am explicitly talking about new applications. If you have to extend an existing application, continue using the existing framework!

    One more disclaimer: I am talking about mission-critical Enterprise Java applications. I am not talking about a little internal application or other uncritical stuff. I also would prefer using a combination of Scala, Groovy and Clojure persisting to a NoSQL database while being deployed at a PaaS cloud service such as JBoss OpenShift or VMware CloudFoundry…

    GENERAL INFORMATION ABOUT JEE AND SPRING

    First, I want to summarize some general information about JEE and Spring:

    • In the end, both alternatives consist of several libraries which can be used by developers to create enterprise applications.
    • Both can be used in most use cases, they have very similar functionality (business logic, transactions, web-frameworks, whatever…) – they only differ in realization (e.g. declarative transactions in Spring vs. conventions in JEE).
    • You also can use only one or some of the available libraries. You can even combine JEE and Spring stuff.
    • Usually, the crucial question is: „Should I use JEE (i.e. especially EJB, JPA, CDI, etc.) or the Spring core framework (i.e. especially Spring Application Context, Spring beans, etc.) for realizing my new application? Mostly, you can choose both, it does not matter from the point of view of the end user. But you should not merge both, this only creates higher complexity.
    • There always was a debate about which alternative to choose. It is very difficult to discuss this question in a neutral way. That’s why almost all discussions end up in praising one framework and bashing the other one (I hope to be neutral in this blog post).

     


    Read the rest of the article at the following URL:

    Java Code Geeks: Why I will use Java EE instead of Spring in new Enterprise Java Projects in 2012

     

    Threaded Messages (15)

  2. The question comes up often. It came up in my new project in November 2011, too. I will use Java EE (JEE) instead of the Spring framework in this new Enterprise Java project.

    ......

    ?It 's an old debate ... I believe that each person can choose what he/she wants.
    But if we want to make a speech like "is it better J2EE or Spring?", well ... 

    My answer (no doubt) is  Spring!
    The ejb + cdi framework is only a small imitation of Spring .. so because not
    use the original?

    More over, with Spring the projects are easy testable, instead with J2EE testing is

    still a challenge (try to use Arquillan....not immediate at all!) 


      

  3. This is indeed an old debate that has been sliced and diced (perhaps too much so) from many different perspectives. Here are a few more resources that I think are worth reading:

    http://www.slideshare.net/ertmanb/javaone-2011-migrating-spring-applications-to-java-ee-6.

    http://www.slideshare.net/kelapure/java-e-evsspringshootout

    http://cdisource.org/site/

    http://ocpsoft.org/java/spring-to-java-ee-a-migration-guide-cdi-jsf-jpa-jta-ejb/

    I think the recurrence and heat in this debate basically reflects the fact that it is as much driven my personal preferences as much as purely technological merit (basically my conclusion in my own analysis).

  4. We are using Arquillan and testing our service layer is far better and easier.

  5. I don't think you make the argument of why JEE is a better choice.  What technical features in your argument make it better. To say it's a standard doesn't cut it anymore.  Spring is a standard.  Maybe a defacto one, but still a standard. I get the wilies when you allude to app containers supporting these standards more and more.  Who needs the dependency.  And now the dependency issue has moved to cloud containers supporting these features too.

    For enterprise apps, it's usually not just one person picking the technology.  Changing course for the sake of changing and without considering the increased dev and maintenance effort of supporting multiple technologies is short sighted.  It you are hiring developers, why pick a technology that isn't trending up or has reached critical mass.  I just think you need to be a little more rigorous when introducing a new technology than what you present.  Not saying don't do it but your argument doesn't meet my threshold. 

  6. You guys have a choice of Java EE or Spring. I have no choice and have to use J2EE 1.4 (with xdoclet) and Struts 1.3.

  7. That's unfortunate. Sounds like you might want to throw in the towel and take a job at a more progressive outfit. I think most folks would understand. The opportunities are definitely out there.

  8. J2EE is not too bad[ Go to top ]

    Well, J2EE is not too bad. In my organization most folks use COBOL and even more archaic tehnologies.

    Back to original question: I would agree that Java EE is a really good technology now. If you really want this,  you  can run most parts of it outside of full container, e.g. JPA as POJO or JSF on top of Tomcat.

    Nowadays even a full container like JBoss 7 starts in couple of seconds, so there is no good reason to use Tomcat if you can run your app inside a full app server.

    I think the best approach is to pick and choose like we are doing for our  mainframe migration project:

    -For batch processing we use Spring Batch with Admin running inside JBoss AS, using JPA as persistence layer

    -For UI we use Primefaces + JSF + JPA inside JBoss AS 

    So far it looks pretty good.

  9. COPYRIGHT problem !!![ Go to top ]

    Hey Ria Dro!

    Stop copypasting the articles of other authors!

    If you like an artcle or a blog post, then please write a couple of words to make it clear, that this is NOT YOUR own article. Something like "An interesting article at javacodegeeks: ...".

     

     

     

     

     

     

     

     

     

     

     

  10. COPYRIGHT problem !!![ Go to top ]

    Hey Ria Dro! Stop copypasting the articles of other authors!

    +1 Better still, just link to the original article (rather than the JCG ugly copy of it), which is actually here

    http://www.kai-waehner.de/blog/2011/11/21/why-i-will-use-java-ee-jee-and-not-j2ee-instead-of-spring-in-new-enterprise-java-projects-in-2012/

    Or TSS, provide people a way to not see "JCG" regurgitation.

  11. Why?[ Go to top ]

    Why are we seeing more and more articles like this over the past 1+ years?  Here's my thoughts.  As always, you know i'm biased ;)

    --

    Bill Burke

    Red Hat

  12. Why?[ Go to top ]

    There are some best selling core Spring 3 books, such as Spring Recipes 2nd Edition. There is another core Spring 3 book in the pipeline, Pro Spring 3.1.

    I haven't seen an in-depth JavaEE6 component book yet. Is this an indication of the popularity of Spring 3 vs JavaEE6 component model in the Enterprise?

  13. Why?[ Go to top ]

    This one for instance ? http://www.antoniogoncalves.org/xwiki/bin/view/Book/JavaEE6

  14. Why?[ Go to top ]

    Great article.

  15. Java EE 6 aka EJB3.1[ Go to top ]

    (First of all, the apparent total plagiarism of this article, as pointed out above, is shocking. At the very least he ought to credit the original author! I guess he might be trying to enhance a job search, you know, when the potential employer googles his name?)

    Try looking for EJB 3.1 books instead. The O'Reilly one is good.

    In my opinion most corporates won't be implementing WebSphere 8 yet and Java EE 5 is nowhere near Spring.

  16. plagiarism[ Go to top ]

    (First of all, the apparent total plagiarism of this article, as pointed out above, is shocking. At the very least he ought to credit the original author! I guess he might be trying to enhance a job search, you know, when the potential employer googles his name?)

    This is the "Ria Dro" autoposting bot set up by JCG to plagiarise other peoples blog entries. Look down TSS and you see it frequently posting. It never replies to any article, just submits "stories" which TSS editors seem intent on publishing without actually checking them for originality.