Book review: “Just Spring”

By Greg Turnquist

Greg is a member of the Spring team, an author of several books on Spring Boot, conference speaker, and the lead for Spring Data JPA.

December 5, 2011

I finished reading “Just Spring” by Madhusudhan Konda over the weekend.

The author states in the preface,

If you wish to get introduced to Spring quickly and precisely, or would like to refresh your knowledge on Spring in couple of hours, or have only a weekend to learn Spring before you start working on it on Monday, this is the book that you should choose.

“Just Spring” definitely lives up to that goal. I was able to read through the book in a few hours, reading probably 90% of the code, and feeling like it hit home with the basics.

I am an experienced Java developer with a strong familiarity with Spring. This may sound like I was able to whisk through the book based on my experience, but that is not the case. I have read several Spring books and can say with complete confidence that the author was very good at making it a light read. The code samples are simple and easy to follow. He didn’t dig into the more complex functionality of Spring, but instead stayed on target with covering the core parts.

Three of the five chapters focus on Spring, Spring Beans, and the Spring Container. They do a great job of introducing dependency injection (DI) as well as Spring’s battle tested container. It shows the benefits of DI along with configuring things using XML and annotations. The author also gives pros and cons of XML vs. annotations. I really appreciated that after discussing this, he took a stand on his own preference and why.

In the fourth chapter, Madhusudhan discusses the essentials of Spring JMS and its powerful JmsTemplate. This includes a 2-minute intro to JMS for the unfamiliar. In ten pages, the author does a good job of showing how to create message driven POJOs. He is also good at pointing out some of the limitations of JmsTemplate, especially its synchronous nature, and how to receive messages asynchronously.

In the fifth chapter, the author wraps things up by introducing Spring Data. In about eight pages, he shows how to use both the JdbcTemplate and the HibernateTemplate. These two powerful utilities were some of the biggest tools that helped empower the Java industry. Some have even said that Spring and Hibernate go together like peanut butter and chocolate, and Madhusudhan does a good job at showing how to set up and use these tools without getting bogged down in unnecessary code.

While reading the chapter on Spring JMS, I debated in my mind whether I would have included this in “Just Spring” were I to write it myself. That is probably because I don’t write heavily message-oriented systems. I would have preferred a chapter about Spring AOP (aspect oriented programming). Perhaps that would have the book too big to read over the weekend. Since the author is already working on another “Just Spring” book, perhaps he will eventually write one that focused on AOP.

I also felt like the Spring Data section was a little out of date when it delved into the HibernateTemplate. In its earlier days, Spring greatly simplified the Hibernate API, but since then, Hibernate has greatly improved their API. Similar things can be said for JDO and iBatis (which aren’t part of the book). The point is, Spring 3 documentation now currently recommends coding against plain Hibernate, JPA, and JDO APIs. But if you are joining a team that uses classic ORM, this section will be of immense value.

Nonetheless, the light writing and easy-to-follow code samples definitely makes it easy to pick up the concepts of core Spring. I would recommend it to anyone who is getting started with Spring or joining a new Spring-based team and wants to catch up quickly.

Disclosure: I was provided a free copy of the book.

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *