EJB Dead? Did Spring Kill It?

EJB Dead? Did Spring Kill It? Here is an interesting conversation on the subject.

I’ve been having an interesting conversation with a co-worker. First, let me state my bias. I am the co-leader of a user group dedicated to promoting the Spring Framework. So I’ll say things like, “there really isn’t any reason to use EJBs” or “with the Spring Framework EJBs are pointless” or “EJBs suck and are irrelevant.” Yeah, I’m leaning to one extreme and being a bit biased. And I’m sure there are a number of EJB success stories, and there might even be a number of Spring failures (I doubt it).

A conversation with my co-worker last week lead to WHO is using Spring. I pointed him to the Spring Framework page that lists users/industries. I also mentioned that back at The Spring Experience there was a lot of talk about various financial institutions in Europe that were successfully using Spring. I also mentioned that BEA gave some talks about Spring and using Spring with BEA.

Anyhow, my co-worker really hasn’t heard much about Spring, except from me. I find that hard, but I guess he doesn’t read blogs, Java related websites, or any recent J2EE design books that might have mentioned Spring. My co-worker said he would talk to his buddy that does a lot of Java/J2EE work (especially EJB work) and see what he thinks about Spring.

Here is their interesting conversation. I am replacing business names with something generic.

My co-worker sent this message:
I work with the head of the Dallas Java Spring Users group. We keep getting into an argument. He insists that EJBs are dead. There is no reason to code EJBs anymore because all you need is a J2EE web container (maybe an app container) and the Spring framework. He claims that all the banks in Europe have completely dropped EJBs. I have no reason to doubt this but if EJBs have died no one told me about it. Why are Weblogic and IBM still selling their app servers?
Is this true? Am I THAT far out of the Java loop right now that EJBs have died and I didn’t notice?

I didn’t say ALL banks in Europe have dropped EJBs, but I DID say that some banks in Europe are successfully using Spring.

His friend’s response:
First, is what do they mean by EJB. If they mean EJB entity beans, then I completely agree (at least until EJB 3.0). If they mean EJB MDB’s then I completely disagree. If they mean EJB Stateless Session Beans it’s a mixed bag as companies will use it if creating a shared API if in a homogenous Java environment. EJB MDB’s are still highly attractive and a key reason standalone containers are being sold. To be honest in our platform we will probably use Spring proxying EJB SLSB calls. The reason is that initially it will reside in a single container, but we are building it so that it can be split into multiple containers. Cost is a driver for this architecture as Process servers, etc. are highly expensive and we wouldn’t want to horizontally scale that solution.

There are two stories in the industry. The first is to explicitly use lightweight containers like Spring. The second is to go with a full blown platform. I think it comes down to the type of application. If it’s a standalone application than I think lightweight containers like Spring are a strong candidate. If it’s not a standalone application (which is the staple of corporate America) then more heavy platforms are used.

An example is at Company A we have to integrate case management of Documentum as well as BPM of Documentum with a 3270 Emulation of IBM HATS with Business Objects reporting as well as LDAP user profiles with a .NET application and the local data in our application. The local data in our application is a very small subset of the problem. To build an application like this with integration from all these services as well as to handle store/forward practices so the application is not dependent on the other systems actually being available is a huge engineering task to build on your own. We are looking at using a Process/Integration server as well as really intrigued by the Data Services product from BEA. Even at a million dollar price tag I believe this is right way to go for the savings in time to market, reliability, etc.

Now at Company B where we had a cluster of 20 servers for the UI and a cluster of 3 servers for asynchronous calls we went the lightweight approach as everything was a standalone application. Here the price tag would have been 10 million dollars had we followed the same practices.

Like anything I think it depends.

BTW, BEA’s largest customers in the EU are banks, and they all are using BEA integration products. I’m guessing there’s similar with IBM.

More Commentary by me:
Interesting response by my co-workers friend. I’m very interested to hear what other people out there think. My problem is this co-worker isn’t interested in Spring and thinks EJB is fine.

2 replies on “EJB Dead? Did Spring Kill It?”

Hi Erik,

remember, in principal, Spring does not necessarily mean that you can’t use EJB, but I’m sure you knew this. Second of all, you need to realize that the scope of the Spring Framework is entirely different from that of first of all EJB and second of all the integration products your co-worker’s friend in mentioning. Spring’s scope is not necessarily broader, mind you. This might be what really causes the disagreement between you and your co-worker.

First of all, indeed there are large (also financial) corporations that use Spring to implement parts of their applications. Some use Spring to solve problems with accessing legacy databases filled with stored procedures. Spring helps here to create a pure-Java layer (with a nicely laid out exception strategy) backed by spring JDBC. This might still be used in combination with EJB. Others are using the complete stack for a certain application and in this specific application don’t need EJB anymore.

Second of all, the fact that certain corporations don’t use EJB anymore for certain applications, doesn’t mean they don’t need a robust application server featuring highly reliable transaction management infrastructure and decent JMS implementation and extensive enterprise integration services (like the ones mentioned in the large scale EAI app).

Also, remember that Spring is about *application development* and less about *application integration*. We’re seeing lots of clients that use Spring to develop certain services in a service-oriented architecture using Spring (deployed on WebLogic or WAS for example). In turn, they integrate those services at the next level using an integration product (service bus, orchestrator, you name it).

In other words, while Spring is focused at the (a) internal application/service code, in a largely integration project there *might* still be a need for an (b) integration strategy that uses different products and using the two together is prefectly possible.


Like most stuff that Erik blogs about he’s WRONG!!! (ok…I’m just joking)

I DID NOT say that Spring was irrelivant. I AM interested in Spring and think it has a place in the J2EE world.

I just disagree that Spring killed EJBs and that Spring makes EJBs pointless. My main point to Erik was that EJBs still had a place and use.

I just wanted to keep the record straight.

Leave a Reply

Your email address will not be published. Required fields are marked *