Skip to content

3. Conclusion

We have presented the key concepts of NHibernate. The sample code is available |HERE| in the form of two Visual Studio 2010 projects.

The [pam-nhibernate-demos] project includes three configuration files [1]:

  • one for the MySQL DBMS [App.config.MySQL]
  • one for the SQL Server DBMS [App.config.SQLServer]
  • one for the SQL Server Compact DBMS [App.config.SQLServerCe]

To use them, simply replace [App.config] with the appropriate file.

In [2], the complete folder accompanying this document:

  • the [databases] folder [3] contains
    • an SQL script to generate the MySQL database
    • a SQL Server 2005 database
    • a SQL Server Compact 3.5 database
  • the [libnet4] folder [4] contains the DLLs required for the Visual Studio project.
  • The [pam-nhibernate-demos] and [pam-spring-nhibernate-dao] folders are those of the two Visual Studio 2010 projects discussed earlier.

This document can be further explored through a case study:

The application in this case study has the following three-tier structure:

  • The [1-DAO] layer (DAO = Data Access Object) handles data access. The data is stored in a database. The [DAO] layer uses the NHibernate framework to access the data.
  • The [2-business] layer handles the business logic of the application, specifically payroll calculations.
  • The [3-presentation] layer handles the presentation of data to the user and the execution of user requests. This is a web/ASP.NET layer.
  • The three layers are made independent through the use of .NET interfaces
  • The integration of the different layers is handled by Spring.NET

And of course, you can read reference books such as the one cited at the beginning of this document:


Title: NHibernate in Action, Author: Pierre-Henri Kuaté, Publisher: Manning, ISBN-13: 978-1932394924