?
Solved

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

Posted on 2014-03-04
4
Medium Priority
?
221 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
[X]
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
4 Comments
 
LVL 28

Assisted Solution

by:dpearson
dpearson earned 450 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 300 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 750 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

Get real performance insights from real users

Key features:
- Total Pages Views and Load times
- Top Pages Viewed and Load Times
- Real Time Site Page Build Performance
- Users’ Browser and Platform Performance
- Geographic User Breakdown
- And more

Question has a verified solution.

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

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…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
Suggested Courses
Course of the Month11 days, 20 hours left to enroll

752 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