views:

1020

answers:

11

My company is looking to use an ORM for new development in .Net. We are currently looking at nHibernate, because of its popularity, however LLBLGen is another option that we may consider. Cost is not a primary factor. We need a solution that provides good separation of the domain model from the database, a good caching strategy, development productivity (i.e. if I can edit it in a GUI instead of config files, great), good customer support.

I know that nHibernate is very popular, but I also know that the price (it's free) may be part of that reason for open source types. Since cost isn't a primary factor (unless the price is > $10,000), which would you choose given our circumstances? Also, what other factors, other than ones that I've listed, would you consider most important in choosing an ORM?

Resolution

We finally decided upon NHibernate as a solution, however in hindsight, I think I would have gone with LL if we had it to do over again. I'm just not found of the xml mapping files. The code generators that I found for NHibernate left a lot to be desired. I do find Fluent NHibernate to be an interesting development, but I'd rather wait for it to mature first before using it.

As it turned out, the most important part of my learning process turned out not to be the technologies, but two design patterns: the repository and separated interface patterns. By defining a repository interface for data access (Jeffrey Palermo has a number of blog posts on this and both the Apress and Wrox MVC books show this as well), we can use LinqtoSQL, LLBLGen, NHibernate, etc. and swap out the DAL implementation later if we switch. So while one of my co-workers is using NHibernate on his app, I chose to use LinqToSQL on my most recent app and it worked just fine.

+3  A: 

I suggest you look at the various similar questions first, e.g: http://stackoverflow.com/questions/380620/what-object-mapper-solution-would-you-recommend-for-net

M4N
+2  A: 

It depends a bit on what you want:

  • Do you want to create your own Domain classes, which you do not have to inherit from some by the ORM defined base class or interface, then NHibernate is the preferred solution.

  • Do you want to auto-generate entity-classes based on your database-model, then you should go for LLBLGen.

Frederik Gheysels
The database will drive the domain. We are essentially in the data warehouse business and the core of our business is to load data, compare data based upon custom rules set up by our customers, and then provide reporting to our customers.It sounds from your answer that LLBLGen Pro would work best.
John
+1  A: 

We use nHibernate a lot. so far so good.

ralph
+6  A: 

If you don't mind paying, I would suggest LLBLGen.

Full list of features here.

From the site:

True database independent code

Full entity type inheritance

Linq support

Typed lists and Typed views

Stored procedures support

Flexible concurrency mechanism

Fine-grained validation framework

Derived table support

Ric Tokyo
Ric - we're using LLBLGEN currently. We're trying to incorporate more unit tests into our new app, and have some difficulties doing so without hitting the database (we use the adapter model). How do you approach Unit Testing LLBL?
Jess
Hi @LuckyLindy I suggest http://ayende.com/projects/rhino-mocks.aspx and create mock objects instead of using the database directly, I think this could be a full SO question almost since you could be asking something deserving a better answer than mine :)
Ric Tokyo
+3  A: 

I've been using LlblGenPro since 2003. It is a great product, reasonably priced, wonderfull support through the solutions design website. Frans (the main developer) issues patches as needed and new full installs frequently, so that clients who are experiencing issues can take advantage of fixes quickly.

The current version supports Linq along with its traditional access infrastructure. Version 3 is in development, but probably won't be released until 2010.

LlbGen starts by reading your current database schema(s) which may save time in developing the db to object mapping compared to nHibernate.

There are things I'd like improved with LlblGen, but I'm a very happy long time user and their support can't be beat.

automatic
nice helpfull comment m4bwav - care to explain why?
redsquare
+2  A: 

Another vote for LLBLGEN, couldn't live without it!

tbone
A: 

SignumFramework has a full LINQ Provider, and it's based on entitiy-driven approach. The other side is that it's fine just for new developments (not for existing databases).

mapache
A: 

If you start from scratch you can use NHiberbate which has a solid background too. But, we are using LLBLGen Pro in more than one project, and it is very solid and orthogonal. It has a very good documentation too. NHibernate has a big community (if we add Hibernate too) but LLBLGen is a very mature product, very helpful forum, and very good documentation.

What is the RDMS to be used? We are using LLBLGen Pro with Oracle, and it absolutely separates database specific and generic operations without problems. It has avoided Inner Platform Effect perfectly. (Think about Oracle sequences and SQL Server Identity fields for example. It is not a problem with LLBLGen Pro.)

LLBLGen Pro is a very extensive code generator. It maps objects in the database to a database access layer as a project(s) that can easily be added to your solution. This has a very good advantage that can not be though of at the first sight : If a stored procedure or even a field changes/removed, you will notice the error at compile time, not run time. So, if you already have a running database, go with LLBLGen Pro.

You can also add its data source components to Visual Studio if you are a drag-and-drop guy and easily bind the data. Some people find it useful for ASP.NET projects.

One more important thing : Typed Lists : These are very useful to create data sources without changing any code in the database. So, if you have some grids displaying data, you can provide data without touching to database which becomes very safe in critical environments.

So, I would suggest LLBLGen Pro even though N/Hibernate has more users.

Caglar Toklu
A: 

For small projects I used Sooda but that was about year ago. Now only and definitely NHibernate.

dario-g
+4  A: 

Check out DataObjects.Net (GPL + commercial).

Alex Yakunin
Also be sure to check out the many discussions highlighting how the above posted link conducts themselves. Blogs are your friend.
FerretallicA