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? thanks. [ December 06, 2004: Message edited by: Tulsi Rai ]
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="http://www.practicalsoftwarearchitect.com" target="_blank" rel="nofollow">www.practicalsoftwarearchitect.com</a><br />- The Paradox of Software Architecture: It is easy to make a complex architecture, but it is difficult to make a simple architecture.
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.