Solved

In JEE, when to use Spring and when EJB 3 ?

Posted on 2014-03-04
4
200 Views
Last Modified: 2015-03-02
In common JEE projects in which specific scenario using Spring would be better and when using EJB3 is advantageous ?
Based on what considerations one can decide either to use EJB3 or Spring

Regards,
Ayan
0
Comment
Question by:mrayandutta
4 Comments
 
LVL 26

Assisted Solution

by:dpearson
dpearson earned 150 total points
ID: 39905624
I may be wrong, but I don't know anyone still using EJBs today.  In the community I'm part of that's generally viewed as a failed technological path.  In part that's because EJBs seem to usually be coupled with JPA/Hibernate, which is also a bit of technological has-been these days.

So if your choice is EJB3 or Spring, I'd go with Spring.

Doug
0
 

Author Comment

by:mrayandutta
ID: 39905646
Hi ,
Thanks for your reply .
You mentioned that  EJBs seem to usually be coupled with JPA/Hibernate nowadays .
I think you are talking about Entity beans in this case .
But apart from that Session beans are also there .
Are they not used any further nowaday ?
I have mainly used Spring in recent years and Stateless session beans in some projects few  years back and for persistance I have mainly used hibernate (not Entity beans).
As a result as I have not worked in EJBs extensively  I do not know the full advantages/disadvantages of it with the latest releases .

As per you ,the trend is to go with Spring .What I want exactly want to when some one is making a decision to choose between EJB3 and Spring, what are aspects to consider ,where Spring is better and how .
0
 
LVL 26

Assisted Solution

by:mrcoffee365
mrcoffee365 earned 100 total points
ID: 39907706
Spring is an implementation of EJBs, and specifically uses Hibernate, which has  limitations if you are going to write a dynamic system making use of a large, complex database.  Also, if you expect to have a very high-traffic site making use of dynamic info in the db, then Hibernate is not your friend.

If you don't have a lot of in-house programming talent, and if your application is expected to stay fairly conventional in its database use, then Spring can help  as a framework.  It's a lot of work to set up, is somewhat counter-intuitive, but once you train your staff, it's no worse as a development environment than EJBs.
0
 

Accepted Solution

by:
manchandap earned 250 total points
ID: 40151453
An interesting comparison can be found here: http://www.visionsdeveloper.com/blog/page/ejb3-vs-spring-framework.jsp

Spring Framework consists of many modules like DI, Spring DAO, Spring JDBC, Spring MVC, Spring MVC etc. Also, it's very easy (and fairly common) to integrate Spring with ORM tools like Hibernate.

One key advantage of Spring is that an application written using Spring doesn't requires any special container to run. Spring provides it's own container. So, a spring app can run on its own as well as in a servlet container like Tomcat.
Since EJBs are written as per Specs, they need specialized containers like JBoss, Weblogic, Websphere etc to run.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now