Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What cannot be done without EJB

If JPA does not depend on EJB and it has its own spec. Why do I need EJB ? What I cannot without EJB ?

I have read the following discussions but I really do not point out why it is still required ?

Why should we use EJB?

https://stackoverflow.com/questions/4464338/why-ejb-is-used-in-enterprise-applications

like image 735
Ahmet Karakaya Avatar asked Mar 20 '23 06:03

Ahmet Karakaya


1 Answers

All of the above answers add important information to the question but misses on one critical point. The main selling point of EJB architecture was distributed component (apart from all other services such as container managed,transactional, secure etc.). The idea was to enable the business logic to run in distributed environment piggybacking on RMI/IIOP. Although over the years this architectural style proved bad. For distributed computing there were more successfull architecture based on webservices. Distributed components though were made look easy by EJB, had their own share of inherent complexities and performance woes and were later avoided whenever possible. An old but very interesting read on this matter by Martin Fowler can be read here where he is scathing in his attack on the lure of distributed architecture typically being promoted by the likes of EJB. Later people seems to have followed this wisdom and avoided the temptation to jump onto the "distributed architecture" bandwagon. In Java landscape, this was marked by the rise of Spring framework and Rod Johnson's famous book "Expert One-on-One J2EE Development without EJB". People and the likes of me have never missed EJB's since then :-)

P.S. To be fair to EJB specs and the guys working hard on it to improve, they certainly have made fair progress in the past decade and they are much modern and developer friendly. However their "distributed" nature has taken a back seat for good

like image 200
Shailendra Avatar answered Mar 30 '23 01:03

Shailendra