Book Review: Spring Data

5 12 2012

I’m reviewing this book thanks to the good people at Packt Publishing that give me a free copy

Spring Data in is own words is:

…an umbrella open source project which contains many subprojects that are specific to a given database. The projects are developed by working together with many of the companies and developers that are behind these exciting technologies.

So, if you already know the kind of support that Spring Framework give to JDBC you could have an idea: Unified Runtime Exceptions Hierarchy, Templates implementation and so on; but for MongoDB, Redis, HBase and others, including extensions for already supported technologies like the afore mentioned JDBC and JPA

The Spring Data book from Packt Publishing, written by Petri Kainulainen covers the JPA extension and Redis support.

First the good parts:

  • The book is very short (161 pages) you can read all in less than a week
  • The author covers well both topics from the Spring perspective
  • The example code is very well written, well formated and concise (very rare on other Packt books)
  • The author approach is more practice than theory, some people love this approach

Now the bad parts

  • The examples use Spring Java Config. Java Config is a special configuration type that let you write Spring Applications without XML. Although more trendy, this is the least used configuration type and not all Spring users feels comfortable with this configuration, and the tooling support isn’t the best
  • The layer architecture isn’t well defined. The service layer have a lot of implementation details that depends on the data layer, so from one example to the other the services implementations change radically.

    This is “understandable” in JPA examples (Spring Data JPA adds dynamic implementations for Repositories) but in the Redis examples, There’s not a Data layer!!

In conclusion

The book cover well both topics, the code is well written, but have some oddities