Saturday, November 13, 2010

Book Review: "NHibernate 3.0 Cookbook"

Are you a .Net developer looking for a way to persist complicated object graphs in your applications? If so, I've got a book you might want to take a look at: Packt's "NHibernate 3.0 Cookbook".

The book is written in Packt's 'Cookbook' style, which means it's really a series of short sections that guide you through achieving some goal you want to accomplish with NHibernate. Each section follows a template, with sub-sections "Getting Ready", "How to do it", "How it works", "There's More".

Let's take an example, say "Configuring the Cache". You may not yet know why you would want to configure cache for NHibernate, but you have a look at that section in the book.

- 'Getting Ready' tells you which artifacts you have to download and how to set up your machine

- 'How to do it' tells you which files to open and what to edit, which buttons in your IDE to click, and which scripts need to be run.

- 'How it Works' at last tells you why the actions you have been taking will be effective. This is the 'theory' that tells you how NHibernate works and why you might want to undertake the task you're currently engaged in.

- 'There's More' is yet more material related to the task in some way. In the cache example, this might be some text about how the cache fits in NHibernate, how you can read it or externally affect it, and other material that's a tangent to your task.

So what exactly is covered, in this decidedly hands-on style? Plenty. You get:

- Models and Mapping (sort of basic Hibernate theory)

- How to manage your schema and the parts that reference it

- Sessions and Transactions-- very important for enterprise applications!

- Queries using NHibernate

- Testing with NHibernate

- Data Access Layer concerns

- Extending NHibernate

- Other NHibernate related projects

Embedded in each of those topics (mostly within the 'How it Works' sections) is a lot of valuable advice about transactional applications in general. Any reader can gain some insights from those.

All things considered, I'd recommend this book to any .Net developer who's interested in using NHibernate. There is much good advice here that can be applied in a variety of situations.

The book can be viewed here.

By the way, the folks at Packt have passed along a couple of other items that might be of interest:

1) The results of the 2010 Open Source Awards are nearly in, they will be announced daily by category starting next Monday. As a professional open source advocate, I'll be happy to pass those results along as they are announced.

2) As a SOA practitioner, I have a respect for the IBM suite of products. (Though I do have to admit I'm partial to JBoss' offerings, as they pay my salary!) But if you're an IBM fan, Packt has a special deal this month on their products. See the details here.

Happy Reading!

No comments: