views:

374

answers:

1

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.

+1  A: 

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.

sal
Yea, that was 5 years ago. Has the situation changed.
Berlin Brown
Of course it has. EJB3 has been heavily influenced by Spring, Hibernate, and POJO development. I still prefer Spring.
duffymo
+1. Spring showed the way it should be done, and EJB3 essentially copied it. However, EJB3 still suffers badly from design-by-committee syndrome, and so it's still nowhere near as good as Spring, which applies its remoting, security and transaction layers in a very simple and consistent manner.
skaffman