Differences between NHibernate, Castle, Linq - Who are they aimed at?


This answer says that Linq is targeted at a slightly different group of developers than NHibernate, Castle, etc.

Being rather new to C#, nevermind all the DB stuff surrounding it:

  • Are there other major, for lack of a better term, SQL wrappers than NHibernate, Castle, Linq?
  • What are the differences between them?
  • What kind of developers or development are they aimed at?


NHibernate and Linq To Sql are Object/Relational Mappers designed to ease dealing with the impedence mismatch found between objects and RDBMS. If you where want to achieve a testable, persistant ignorant application, NHibernate is the way to go. I would always recommend NHibernate over Linq To Sql. Both tools are aimed at removing dealing with data access. How many times do you really need to write data access code?

Castle is an application framework and Inversion of Control container and doesn't provide data access. It supplies facilities for using NHibernate, making for less friction, and it also supplies an implemenation of the Actuve Record pattern using NHibernate.

Actually we use both Linq and NHibernate together (with Fluent). If you have a little patience with the learning curve, then you will quickly fall in love.

LINQ is just a set of new C# features: extension methods, lambda expressions, object initializers, anonymous types, etc.

"LINQ to SQL" on the other hand is something you can compare other SQL wrappers.

By : Hallgrim

This video can help you solving your question :)
By: admin