It's not a secret anymore!
The moose likes EJB and other Java EE Technologies and the fly likes EJB - just a hype or absolutely necessary? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "EJB - just a hype or absolutely necessary?" Watch "EJB - just a hype or absolutely necessary?" New topic

EJB - just a hype or absolutely necessary?

Brian Smith
Ranch Hand

Joined: Oct 26, 2002
Posts: 232
Hi Folks,
EJB has been out there for a while and been used in industries. I know it helps with data persistency taking care of all the low level data persistence. But I have also heard its downside being slow performance and taking more resources. my questions to EJB supporter or implementors, is EJB absolutely necessary or what are the situation EJB is a must? can't we just use other persistence framework like JDO or Hibernate instead so that we can get the EJB's work done with high performace?
[ December 06, 2004: Message edited by: Tulsi Rai ]
Bruno Collet
Ranch Hand

Joined: Jun 08, 2004
Posts: 40
EJB is not only for persistence. The EJB container offers a number of services including life cycle management, security, transactions, distribution, etc. (see J2EE tutorial).
Whether you should use EJB or not depends on whether you need these services or not. If you need a significant number of these services, then you should consider using EJB. Why? Because you need either to use another framework or implement the services yourself (which is very time-consuming). In contrast, if you don't need these services then EJB might be overkill for your application. In conclusion this is a trade-off between performance cost and features. But bear in mind that most entreprise applications need most or all of these services. Also, there are several EJB best practices and optimizations that significantly reduce the performance cost.

Bruno Collet<br /><a href="" target="_blank" rel="nofollow"></a><br />- The Paradox of Software Architecture: It is easy to make a complex architecture, but it is difficult to make a simple architecture.
Peter Rooke
Ranch Hand

Joined: Oct 21, 2004
Posts: 817

Have a look at some of the previous postings - this subject been discussed before. I've only been a member for three months, but have seen this asked a few times. I'm not going to try to answer, but two things to know:

1) EJB's are for distributed transactional systems - that’s why there’s a lot of overhead. The key world is distributed.

2) EJB3 will hopefully make entity beans easier to develop and maintain.

Regards Pete
Jeroen Wenting
Ranch Hand

Joined: Oct 12, 2000
Posts: 5093
EJB is 90% hype, 10% substance.
That is, 90% of projects using EJB would have been better (read: cheaper, better performant, easier to maintain) had EJB not been used.

I agree. Here's the link:
subject: EJB - just a hype or absolutely necessary?
It's not a secret anymore!