<pre>
Author/s : Rob Harrop, Jan Machacek
Publisher : Apress
Category : J2EE
Review by : Lasse Koskela
Rating : 9 horseshoes</pre>
Looking at "Pro Spring", one can immediately see that it packs a lot of information. The page count almost reaches 800 and the table of contents does indeed seem to cover pretty much anything there is to know about the Spring Framework. The first parts of the book introduce the Spring Framework on a bird's eye level, the sample application used throughout the book as a playground for the examples, and explain some basic concepts like Inversion of Control and Spring's basic bean-wiring facilities. After page 150 or so, it's all about digging deep inside the vast number of features and modules under the Spring umbrella.
The Spring AOP framework is introduced quite well, starting from the fundamentals like what is a pointcut, what is a joinpoint, etc. One really understands what the framework is about after reading through the AOP chapters. The data access part, which no doubt is of high interest to most readers, also does a good job on showing how the Spring JDBC framework works. It also presents a very nice "tutorial" on integrating Hibernate with Spring, although it's certainly not by any means a complete resource for learning Hibernate itself. The data access part also covers the iBATIS SqlMap framework for object-relational mapping (and actually uses more pages on that than for the Hibernate integration) which, on the other hand, was a nice surprise. Then again, the authors had decided not to cover Spring's JDO integration at all (only a brief mention somewhere near the beginning) which I would've expected. I gather JDO is not that widely used to date so maybe that isn't a problem (and the Hibernate stuff is very close to what the JDO integration looks like anyway). One specific thing I especially liked about the Hibernate chapter was that the authors had gone through the trouble of actually showing the SQL being generated for the different kinds of mappings. That's not really relevant for Spring but it was such a nice surprise that I felt like mentioning it anyway.
The heart of the book then covers "Spring in the middle tier", i.e. transaction management, integrating J2EE components such as Enterprise JavaBeans, job scheduling, sending email, and remoting with the various protocols supported by Spring. The technologies and APIs are not all there is to this part, though. Chapter 11 provides a more thorough discussion on good design practices and common pitfalls. Actually, the authors have managed to sprinkle these also elsewhere in the book in smaller amounts. The only thing that's really missing here is security, partly because the Spring core project doesn't provide much support for authentication and authorization (that's being handled either by custom frameworks or by the Acegi Security Framework project).
The last 100 pages before appendices have been dedicated to using Spring in web applications. The Spring MVC framework itself was described quite nicely, although I was left hanging a bit trying to wrap my head around the different base classes for controllers, resolvers, and so forth. Then again, I've had the same feeling with all (2) Spring books I've read so far. In addition to the standard
JSP view, integration with the Velocity template engine and other alternative view technologies such as XSL transformations, the Tiles framework, PDF generation with iText, and Excel generation with the POI library are briefly demonstrated with JSP tags and Velocity macros getting most of the attention. One short chapter has also been dedicated for presenting the integration between Struts and Spring--a topic that many have struggled with.
Finally, the appendices showcase the Spring Rich project for building rich clients on top of Spring, the Spring
IDE Eclipse plugin, and some features that are coming (or have already by now) soon such as JMX integration. Perhaps the most important appendix is, however, the one titled "Testing with Spring", which gets you going with
unit and integration tests that use the Spring bean container. I would've loved to read more about this topic but even these few pages are a big help for a beginner since the first steps are often the most critical ones and having someone show initial direction can save the day.
In summary, "Pro Spring" is a good book and a valuable reference in learning Spring. It's not a book you'll want to carry around too much but it does include plenty of sample code (with just a few obvious typos that are easy to figure out) both Java code and the corresponding configuration elements. It's not the be-all-end-all reference for Spring but it's pretty close. A second edition with JDO and Acegi covered could be a full 10 horseshoes.
More info at Amazon.com More info at Amazon.co.uk