Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Are Enterprise Java Beans still useful when compared to Spring?

I have an upcoming project in a class that will allow me to work with either EJBs or Spring, and I was wondering what would be more applicable for "real world" situations.

like image 984
Thomas Owens Avatar asked Jan 24 '23 17:01

Thomas Owens


1 Answers

The two technologies aren't mutually exclusive. And when you say EJBs it depends on if you're talking about session beans or entity beans (or message driven beans for completeness).

Stateless session beans are and always have been quite useful if for no other reason than they provide a reasonably consistent and low barrier-to-entry to distributed transactions.

EJB3 also takes a leaf out of Spring's book with some dependency injection features.

That being said, this has been a long-running cause of dispute.

It's probably worth reading some of the (many) comparisons on the Web such as this one.

It's really hard to recommend one over the other without knowing your requirements. Personally I favour Spring though unless I've got a good reason not to.

like image 74
cletus Avatar answered Feb 01 '23 17:02

cletus