Skip to content

3. Conclusion

We have presented the important concepts of Nhibernate. The sample code is available |ICI| in the form of two Visual Studio 2010 projects.

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

  • one for SGBD MySQL [App.config.MySQL]
  • one for SGBD, SQL, and Server [App.config.SQLServer]
  • one for the SGBD SQL Server Compact [App.config.SQLServerCe]

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

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

  • the folder [databases] [3] contains
    • a script SQL to generate the database MySQL
    • a SQL Server 2005 database
    • a SQL Server Compact 3.5 database
  • the [libnet4] folder [4] contains the DLL files 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:

  • Building a three-tier application with ASP.NET, C#, Spring.net, and Nhibernate [http://tahe.developpez.com/dotnet/pam-aspnet/]

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-métier] layer handles the business logic of the application, specifically payroll calculations.
  • The [3-présentation] layer handles the presentation of data to the user and the execution of user requests. This is a web layer / ASP.NET.
  • The three layers are made independent through the use of interfaces .NET
  • 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: 978-1932394924