For a new web project I’ve been learning the Spring Framework. Based on a few recommendations I’d read around the blogsphere I ordered a copy of Pro Spring and I’ve gotta say I’ve been hugely impressed.

I’ve been reading/implementing for around two weeks. When it arrived I was sure it was a lemon (how could it cover MVC in a measly 45 pages?). What I didn’t count on was how good the examples are. Sure, you don’t get the total coverage of a dedicated MVC book, but you get excellent coverage of more areas of the framework than you could possibly imagine.

The database-driven web app I’m building is using Velocity, iBatis, Postgres and Spring (what I’m calling VIPs ;-), and, even though I’ve used iBatis before, I’ve learned heaps of tricks while reading the Spring/iBatis integration chapter (like using inheritance in resultmaps). I’ve got parent/child selects and inserts going on, I’ve got my auditing going to the database (using a Spring HandlerInterceptor to check page access), I’ve got connection pooling and all sorts of cool stuff. And I’ve been having a ball all the way through.

Even the mail integration chapter is awesome! Gives great examples of generating rich html emails using Velocity with embedded images (exactly the thing I’ve always wanted to do with mail!).

The appendix on unit testing is also full of gems! What a great idea to have a transactional unit test that you can roll back when your test is done without touching your test db!

What has really surprised me about this book is the rich quality of the examples. There have really picked stuff that you want to do in the real world. In fact, the more I get into this book, the more battle tested it feels. It definitely has the feel of “we’ve built a dozen production apps in this framework, and here’s the dirt on what we’ve learned along the way”. I love that in a book!

I’ve had a scan through Spring in Action and at first glance it doesn’t seem to have either the breadth or depth of Pro Spring. Matt Raible’s Spring Live looks very cool, though (particularly since he has stuff in there about Spring WebFlow). Be good if SourceBeat provided a detailed table of contents, though, where you could see the details of what’s covered before buying a copy (rather than just see the title of each chapter).

Anyways, Pro Spring gets a huge tick from me! Great job, Rob & Jan! And great stuff apress! Highly recommended!