Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

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

Posted on 2014-03-04
4
207 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 27

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 27

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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:

840 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