-
When mapping objects to the database in NHibernate you can either use XML files or decorate your classes with mapping attributes (NHibernate.Mapping.Attributes). I've used both but I usually choose XML files simply as a matter of personal preference. Either method works well and both provide many...
-
While writing the code necessary for this installment, I found myself falling prey to feature-creep. So I've decided to keep it fairly simple in the beginning. However, once the basic components are working I'll start introducing more features. I thought this might be a good way to demonstrate...
-
When I first started learning and using NHibernate, I read every tutorial, downloaded every example, and studied every code snippet I could get my hands on. There are some great resources available with one of the best being Billy McCafferty's NHibernate Best Practices. In my opinion, the majority...
-
[Updated May 9, 2007: Clarified contest rules to downgrade some "requirements" to be "suggestions" instead. I.e., there's now a little more wiggle room in the implementation details.] A contest guaranteed to challenge you! This contest involves integrating Castle Project facilities into an existing project...
-
I've updated the CodeProject article NHibernate Best Practices with ASP.NET, 1.2 ed with a number of very important fixes and pedagogical expansions. (I've been waiting for an excuse to use that word.) If you've been using the sample code as a foundation for your project, these changes will...
-
[Updated March 10, 2009: Important!! While the original content shown below is usable in most cases, there are scenarios wherein it breaks down. The results of GetHashCode should not also be used as the means for expressing object equality. Accordingly, this, and other issues have been resolved and may...
-
Previously, I mentioned Peter Weissbrod's introduction to performance tuning NHibernate backed applications. Peter worked wonders on a previous project of mine with respect to finding bottlenecks and prescribing appropriate remedies. Peter's back with a second installment of suggestions which...
-
I'm very pleased to announce the release of NHibernate Best Practices with ASP.NET, 1.2 nd Ed. on CodeProject.com. Preface to the 1.2 nd Edition In March of 2006 I published my initial thoughts on NHibernate best practices with ASP.NET, generics and unit tests. I've been delighted to learn that...
-
[Updated 4/3/07 - Added recommendation to move add/remove methods to a custom collection.] While using NHibernate 1.0x, developers who wanted support for generics often turned to Ayende's Hibernate.Generics . Since the use of generics is now natively supported by NHibernate 1.2, you'll no longer need...
-
One of the most frequent hesitations I hear from people, who haven't yet realized the value of a good ORM, is the worry of performance degradation. Just like any other framework, an ORM can certainly be misused and become a self-fulfilling prophesy for these nay-sayers if basic design considerations...
-
I've been asked a couple of times how to give a domain object access to a dependency injection (DI) container, such as Castle Windsor, if the domain object is loaded via an ORM, such as NHibernate. There are two apparent ways to do this: 1) you can manually give the domain object access to the DI via...
-
Pierre Henri Kuaté challenged his blog readers to figure out what he's been up to lately. The recurring guess was that an NHibernate book was in the works. Not only were these guesses correct, but Kuaté has gone as far to team up with Gavin King and Christian Bauer to create the upcoming title NHibernate...
-
There are a few Java/Hibernate books out there, a couple chapters here and there on .NET/NHibernate, but a glaring vacuum for published material concerning the development of ASP.NET/NHibernate applications, specifically. ASP.NET certainly has plenty of special cases when it comes to integrating NHibernate...