views:

263

answers:

4

I am using C# 3.0 / .NET 3.5 and planning to build an eCommerce website.

I've seen NHibernate, LLBLGEN, Genome, Linq to SQL, Entity Framework, SubSonic, etc.

I don't want to code everything by hand. If there is some specific bottleneck I'll manage to optimize the database/code.

Which ORM would be best? There is so much available those day that I don't even know where to start.

Which feature(s) should I be using?

Links, Screencast and Documentation are welcome.

+1  A: 

I can only really speak for LINQ-SQL and can say that it is:

  • Easy to use
  • Quick to get you up and running
  • Good for simple schemas and object models

but it starts to fall down if:

  • You're using a disconnected (tiered) architecture because its datacontexts require the same object instances to perform tracking and concurrency (though there are ways around this).
  • You have a complex object model / database
  • Plus it has some other niggles and strange behaviour

I'm looking to try EF next myself and MS seem to be quietly dropping LINQ-SQL in favour of EF, which isn't exactly a ringing recommendation of LINQ-SQL :)

flesh
+2  A: 

I've been using nHibernate which is a very good free solution. The one downside is the lack of documentation, which causes a slightly steep rampup time. But once you get the basics down it really speeds up development.

I like Fluent nHibernate for a way to configure without the xml files. The one thing I suggest though is to abstract out your data access from your application. this way should you choose wrong you don't have to worry about re-coding the App tiers.

JoshBerke
+1  A: 

That depends on the architecture of the data model. I can speak to the effectiveness of SubSonic, since I'm in the process of launching a web app that it backs.

I've run into problems with JOINs and DISTINCTs while using SubSonic. Both times, all I had to do is patch the source and rebuild the DLL. Now, I'm not at all averse to something like this, but you might be.

Other than those two problems, SubSonic is a joy to use. Selects are very easy and flowing. It maps fairly closely to SQL, much the same way LINQ does. Also, SubSonic comes with the scaffolding function that should be able to pre-build certain pages for you. I'm not sure how effective it is, since I like to do that stuff myself.

One more thing, selection of specific rows as opposed to * is slow, but only in debug mode. Once you compile for release, it's actually faster.

That's my two cents.

Srdjan Pejic
A: 

I started out using Linq to SQL as the whole linq integration is awesome, but if you want to do Model First rather than Schema First and you want to have a rich domain model then nHibernate\Fluent nHibernate is really the way to go. We switched to this and is far simpler, better supported than l2s. However for straight dragging your schema into the dbml code generator, linq to sql is great. I have also heard very good things about Mindscape Lightspeed but have not used it.