SA Developer .NET

Welcome to SA Developer .NET Sign in | Join | Help
in Search

NHibernate Starter Kit

Last post 12-09-2008, 10:32 by KevinT. 4 replies.
Sort Posts: Previous Next
  •  11-17-2008, 20:25 15737

    NHibernate Starter Kit

    Hi all

    A short while ago I created a Visual Studio template for NHibernate. When installed (it's a .vsi) a new project type becomes available within Visual Studio which contains all required NHibernate binaries, a sample domain with mappings, a console application which generates the database and inserts some test data, and some sample unit tests (closer to integration tests).

    You can read about it in my first post, and the recently updated version in this one. Note that it only works with VS2008, but the template is installed in 2005 too. It seems the vscontent schema is not adhered to by the installer.

    For anyone who has wanted to play around with NHibernate, but found it a little intimidating, I hope this helps.


    The high road might seem longer at first, but you'll enjoy the downhill at the end...

    http://blog.benhartonline.com/
  •  11-18-2008, 7:52 15741 in reply to 15737

    Re: NHibernate Starter Kit

    Thanks! This is excellent stuff!

    Why go against tradition when we can admit defeat, live in decline, be the victim of our own design?
    http://dotnet.org.za/calmyourself
  •  12-09-2008, 9:33 16059 in reply to 15737

    Re: NHibernate Starter Kit

    Thanks for that, 

    I was watching some screencasts of ADO.NET Entity Framework last night.

    The msft presenter dude said it was introduced to do the same work that NHibernate does but better because its released together with the frameworks whereas NHibernate takes a while after a framework release.

    Which one is better to jump into NHibernate or ADO .NEt Entity Framework then? 

  •  12-09-2008, 10:00 16063 in reply to 16059

    Re: NHibernate Starter Kit

    There are various reasons that some might consider EF better than NHibernate, the fact that EF is linked to releases of the .NET framework is not really one of them. This works the other way too - if, when released with the framework, people have major objections to EF, users have to wait at least 18 months for the new version. NHibernate, while not always taking advantage of latest language features, can release at its own pace (dictated, incidentally, by how many people are able to contribute). Broadly, they do perform the same function in a system, how they go about is very differently though.

    I will say without a minute's hesitation that NHibernate is the better one to jump into. This strong opinion is formed on my own, though, and is based on criteria that you might not care about. Entity Framework has some interesting features, and has potential, but as it stands I cannot work with it, nor do I want to. V2 looks better, but NHibernate is the best ORM, hands down.

    In a nutshell, try them both, and form your own opinions. Read about persistence ignorance (PI), and decide whether it's something important to you. Consider whether you're a drag-and-drop guy, and how important things like designers are to you. Consider whether having access to the source (real access, live and unfettered) is important to you. Understand the various layers in EF, and what they're doing, and why.

    Once you start understanding ORM tools, and decisions the designers need make (and EF and NH give you two good points for comparison) you'll be set.


    The high road might seem longer at first, but you'll enjoy the downhill at the end...

    http://blog.benhartonline.com/
  •  12-09-2008, 10:32 16065 in reply to 16063

    Re: NHibernate Starter Kit

    +1 for NHibernate

     

    (note though that i have only seen the demos and presentations and read the discussions about EF, I haven't actually used it myself yet. So my opinion might change, but at this point I think EF is to NHibernate what MSTest is to NUnit)


    Driven Software
View as RSS news feed in XML
Powered by Community Server (Commercial Edition), by Telligent Systems