Spring and EJB 3 and NEJUG
Back in 2004 at the Server Side Symposium, I remember watching Linda DeMichiel present EJB 3 to the world for the first time. At the time I thought it was remarkably similar to the Spring/Hibernate project that I was developing, and I know that many others in the room had the same thought. Ever since that day we’ve had comparisons between Spring and EJB 3 as a reoccurring thread of discussion in the Java community. Thursday night was a continuation of said discussion, and it took place at the NEJUG. This is where Reza Rahman, one of the authors of EJB 3 in Action presented this topic. I was fortunate enough to have a seat next to Mark Fisher who scribbled copious notes and has written a great analysis on the i21 blog.
The presentation contained some outdated information about Spring which Mark details in his blog entry. To be fair, a good amount of the presentation was subjective (which makes it more interesting) and Reza obviously knows more about EJB 3 than about Spring. I’m sure that he will use Mark’s information to enhance this presentation which covers a topic that clearly is relevant and carries a lot of interest in the community. (The attendance and feedback at the user group are but one indication of this relevance.)
It isn’t my intent to add more fuel to the fire, but I did have a few thoughts on some of the subjective points of discussion:
EJB3: High degree of portability, Spring: Possible vendor lock-in.
The goal of Spring is to be a non-invasive framework, and the documentation emphasizes that end user code should not depend on Spring. This is an attainable goal for the most part, but I suspect that most real world projects of a significant size are importing org.springframework.*, in particular the DAO layer (especially when using the JDBC template.) Is this a problem? It depends on the kind of portability desired. Personally I like the ability to use older containers, newer containers, or no container at all. Applications should minimize coupling, but the application has to be coupled to something in order to do anything useful. An application coupled to Spring will have a much easier time adapting to other environments than an application coupled to EJB. I think it is quite ironic that it is easier to “port” a Spring application to EJB 3 than it is to port an EJB 2 application to EJB 3.
Aims to be a “defacto” standard and might make good on the promise.
This is just my opinion, but I have long considered it a defacto standard. I spend a good portion of my day looking at stack traces and thread dumps from customers, and most of them are using Spring.
Overall it was a good presentation, and I certainly enjoyed discussing the topic with the attendees. It will be interesting to see if Mark’s comments influence future revisions of the presentation.
Speaking of JUGs, this Tuesday I will be presenting Orchestrating Messaging, Data Grid and Database for Scalable Performance at the Central Ohio JUG near Columbus.