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.
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.
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