Archive for January 13th, 2005

Hibernate in Action Review

bauer_cover150.jpgHibernate in Action by Christian Bauer and Gavin King, Manning Publications.

Hibernate is arguably one of the most interesting and useful Open Source projects around. If you develop enterprise Java applications that have to do with a relational database (and which one doesn’t?), then you should seriously consider using an Object/Relational Mapping (ORM for short) tool as an alternative to straight JDBC, in particular if you have a rich domain model and you’d like to exploit the object-oriented features of the language, like polymorphism, and core libraries like the Collections API.

This book comes straight from the source. Gavin is actually the founder of the project and Christian is one of the most prominent developers. It is not surprising, therefore, that the book explains some of the design decisions that have shaped Hibernate into what it is now, like using runtime bytecode generation in preference to source code generation or post-compilation bytecode manipulation.

Hibernate is not easy to learn and use proficiently if you’re not prepared to study it thouroughly and this book does a good job of explaining tricky subjects like the persistent objects’ lifecycle, exotic mappings, transactions and so on. However, it would be quite hard to use it as a single reference source while working with Hibernate. You should be prepared to refer constantly to the reference documentation, the API docs and the huge knowledge base available through the online forums.

At a little more than 400 pages, it is not a particularly thin book, yet I would have appreciated a more systematic treatment of the APIs and the different types of mappings, with more code samples. As it is, you’ll find it a very useful and interesting book if you’re about to start a new project and want to know whether Hibernate is the right solution to your persistence problems. If you’re a developer interested in using Hibernate, I suggest giving it as a present to your technical mamanger or team leader. In this case, I’d give it five stars

On the other hand, if you’re already experienced with Hibernate, it is much less useful but nonetheless very iteresting and well-written, so I’d give it four stars.

Average evaluation: 4.5 out of 5.