I have read for a while that EJBs are not useful or cumbersome. But what other ways implement the business delegate pattern?
How do EJBs differ from the approach the Spring recommends?
Also, how have recent advances with EJBs changed your opinion.
EJB is still there and growing up. There are many new features (SOAP/RESTful webservice, JPA entities, JAXB...)
The Spring Framework is an application framework and IoC container for the Java platform. The framework was initially created as an alternative to EJB. Spring offers modular approach to adding new functionalities, which means that developers can use only parts they're interested in.
The key difference between EJB and Spring is that EJB is a specification of Java EE while Spring is a framework or an implementation. Another key difference is that Spring does not support propagation of transaction context across remote calls while EJB does the same.
Spring is a framework. It can inject anything in the container including EJB Data sources, JMS Resources, and JPA Resources.
If your goal was to start a flame war, replace "EJB" with "Java" and "Spring Framework" with "Ruby on Rails".
If not, check out Rod Johnson's book from 2004 for detailed explanation of why EJBs got such an awful reputation and what Java development issues Spring was designed to remedy.
While the book is five years old at point and predates EJB3, and you need to filter out the subjective and anecdotal; keep in mind on little thing. It is simple to google for examples of migrating from EJB to Spring, it is almost impossible to find stories of Spring to EJB3 migration. I don't think that is by accident.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With