7/09/2012

NHibernate 3.0 Cookbook Review

NHibernate 3.0 Cookbook
Average Reviews:

(More customer reviews)
My first impressions are good - it starts out with creating a model and the usual XML-mapping stuff, and then it dives directly into modeling an inheritance hierarchy. I think this is pretty cool, because it is a sign that the book has a fairly high level of ambition: It is not just about stuffing away rows in the db, it's about persisting an actual model!
It covers Fluent NHibernate and Fabio's ConfORM as well, so it provides a really good foundation to anyone interested in learning the intricacies of configuring NHibernate. And it is pretty true to the model-first approach, which is how I like it.
Then it goes on with a chapter on how to manage sessions and transactions including - among other things - an example on how to manage the session from an ASP.NET MVC action filter (which is not "best practice" from an ASP.NET MVC perspective IMO, as it relies on static gateways, but I digress... the book is not about ASP.NET MVC :) )
The query chapter is great, because it covers everything I can think of: Criteria, QueryOver, HQL, both in their normal and multi forms, futures, LINQ to NHibernate, detached criteria, and the new HQL bulk operations, insert and update. If I must put my finger on something, I think that the different areas are covered a little too lightly, but hey - there's plenty of information on this stuff on the internet, and you could probably write an entire book entirely about how to put HQL to use.
The testing chapter is great as well, as it touches on nice-to-know stuff and some of "the new developments" in the area: NHibernate Profiler, Fluent NHibernate automatic persistence testing, using in-memory SQLite for persistence testing, + more.
The chapter on implementing a data access layer shows a typical data access object and a repository implementation which will probably look familiar to a lot of people, implemented with NHibernate. They both have the ability to automatically perform their operations withing transactions, if one is not already active. This makes the implementations pretty flexible, as they can be used either "by themselves", or they can implicitly enlist in an ongoing unit of work. Moreover, a pretty nifty named query implementation is shown, complete with automated test that checks whether all implemented named query classes have corresponding named queries in an HBM XML file.
The rest of the book shows how various common tasks can be achieved using NHibernate or some of the many NHContrib projects, like e.g. creating an audit trail by listening to events, creating an IUserType to encrypt strings, using Burrows to manage session, putting NHibernate Search to use, etc... As you can probably imagine, this stuff is covered pretty lightly, but it's sufficient to give an impression on the huge ecosystem that surrounds NHibernate, which is great.
Conclusion
It strikes me that the book is definitely a "no BS-book" - there's plenty of code, which is mostly high quality and sufficiently best practice-compliant, and recommendations throughout when there are decisions to be made. If I should criticize something, I think the sheer amount of code makes for an exhausting casual read it does, however, claim to be a "cookbook", so I guess that's just the way it is.
The book is probably great for developers, who are either new to or semi-experienced in using NHibernate, but have a general high level of experience and skills.
All-in-all a good read, and it's great that it touches on so many things in and around this huge framework!

Click Here to see more reviews about: NHibernate 3.0 Cookbook

This book contains quick-paced self-explanatory recipes organized in progressive skill levels and functional areas. Each recipe contains step-by-step instructions about everything necessary to execute a particular task. The book is designed so that you can read it from start to end or just open up any chapter and start following the recipes. In short this book is meant to be the ultimate "how-to" reference for NHibernate 3.0, covering every major feature of NHibernate for all experience levels. This book is written for NHibernate users at all levels of experience. Examples are written in C# and XML. Some basic knowledge of SQL is assumed.

Buy NowGet 14% OFF

Click here for more information about NHibernate 3.0 Cookbook

No comments:

Post a Comment