Spring vs JBoss, and why I don’t care about Sun standards
May 28, 2006 35 Comments
Beyond the obvious entertainment value that one gets as an outside observer to these kinds of things, it is interesting to analyze what the JBoss folks are up to and what they appear to be doing to counter Spring. And please, if you hear anyone from JBoss say that they are OK with Spring – they don’t see it as competition etc., if you believe that, don’t read this blog entry…!
Rod Johnson appears to have uncharacteristically lost his cool when faced with this comment from someone in the JBoss camp:
All those features in or out the app server are the real value of projects like JBoss Embeddable EJB3: the same code run both in and out of app server (or in another one).
Wow. What a great idea! Imagine if someone had thought of that back in 2002. Imagine if there was a project used very very widely that gave you the same model inside and outside the app server across a wide range of functionality. There’s a whole world outside JBoss technology :-)
Rod is understandably laying on the sarcasm, not only has JBoss flipped and embraced the POJO, they are trying to make it look like they came up with the whole idea. In the next JBoss versions, they are replacing the JMX based microkernel with a POJO based one. So one thing is clear: both the Spring and JBoss camps agree on something.
I can’t believe that Gavin pushes the talking point that AOP is no big deal.
However, the fact is that full AOP has basically zero traction in the developer community and that to shovel it into the EJB spec would be a terrible idea at this point. Moreover, almost all of the interesting problems you might think you need AOP for can be solved by interceptors + annotations – an approach that is much more understandable to nongeniuses. To me, AOP looks like totally overhyped, failed technology right now. (Of course, future history could prove me wrong on this.)
Or maybe its a defensive reaction to one of the main criticisms of the EJB3 spec.
I have been meaning to rant about a few things for a while, and maybe now is a good time, especially after all that Java One excitement has died down. Boy, am I glad that I don’t work for Sun, JBoss, IBM, BEA or even Interface21 for that matter – I don’t need to sprinkle my posts with sugary hints on how great technology A is, or that B is the best thing since sliced bread – unless I wholeheartedly agree. Here’s a few things I want to say on the oh-so-frustatingly wide world of Java EE:
Sun Specification != Standard – just because some technology carries a Sun “rubber stamp” and is touted as a specification does not mean that a) it is good or b) that it will last or c) that it is superior to other technologies. Classic examples: Entity Beans. The whole EJB 1.X and 2.X specifications.
Everyone agrees that to a large extent: EJB3 = Spring + Hibernate. What does this mean? To put it bluntly – Sun got it wrong and had to revise the specification. Innovation happened outside of Sun. A fresh perspective did not come from IBM, BEA or Oracle. It was the open source community that made things happen. Rod Johnson did a huge service to the entire Java community with that first book of his, and I was lucky enough to have read it at that time.
Now, we are in the middle of a new wave of JSRs, and specifications like EJB3, JPA, the JBoss camp pushing Seam as a new specification, the NetBeans camp raving about Java EE development, MVC frameworks being released right and left and something called Google Web Toolkit. I sometimes feel that it is too much work to be a Java developer nowadays. There is no option but to pick one out of the gazillion frameworks out there, hope that your pick will stand the test of time and focus on it. (And also bash the other “rival” frameworks on public forums for good measure :)
Java developers should keep an open mind and not trust anything that emerges as the result of a “design by committee”. A large part of what goes into a specification, will be the political agendas of the committee members. Ask yourself whether they will really give top priority to the needs of developers, or really try to keep things simple. This is why I like open source, the chances that something proprietary is created is far less and things are far more democratic. Unfortunately the open source landscape is getting increasingly commercialized nowadays…
I’m a blatant Spring fan, but one part of the thread I am referring to grabbed my attention: the part about conversations / optimistic transactions and the dreaded Hibernate LazyInitializationException. I use Spring and Hibernate and with Spring MVC the OpenInSessionViewFilter works fine. However I immediately ran into problems when using Spring Web Flow with Hibernate – and it looks to be something that still needs to be resolved, as of now.
PS: I hope GWT kills JSF and most of the other MVC frameworks. There are too many out there! But seriously I think GWT is something really really big. More on that later.
PS PS: I hate JNDI and I hate annotations. The Spring XML way is better.
Update 2007-03-07: Wicket Impressions: a post comparing Wicket with Spring MVC / WebFlow and some other frameworks as well.