Sunday, May 23, 2010

Can we all agree that Spring isn't that lightweight?

Sorry Planet, this is merely tangentially Linuxy. I promise the next post will be more Linux & Fedora related, although that may not be for a few weeks.

So I've been working on a simple little Java web app as a learning tool for myself. The stack I'm using is Stripes 1.5.3 (a great little web framework that I'd like to package for Fedora), Spring 3.0.2, Hibernate 3.5.1 with Apache Derby in Tomcat 6. The reason I'm using this stack, rather than something like Glassfish or a JBoss 6 milestone, is for the express purpose to try out the new releases of Spring and Hibernate. The additional experience with the two frameworks is helpful as well. I'm actually using Hibernate as a JPA2 provider rather than native Hibernate.

Anyways, the refrain I've often heard about Spring is that it's "sooo much lighter weight than Java EE". Now, this was most assuredly true back in the dark days of EJB2 and J2EE 1.3/1.4. The world has since moved on to Java EE 6 which looks very spiffy and developer friendly with EJB 3.1, CDI and JPA. Back to Spring, from a developer's point of view, managing the 31 jars I needed just to get a single crud page working is a little involved and practically all of it came from Spring's dependencies. I needed 10 separate org.springframework jars plus their dependencies for a relatively trivial web application. The winner was of course the esoteric error messages explaining to me why it couldn't autowire something (missing configuration item for the transaction handling, which led to missing jar dependency to enable that feature). That Java EE App Server that bundles all the stuff I need? Yes please!

P.S. Yes, I know of Maven, but I wanted to keep the scope creep to a minimum for this project.