Data Access Technologies - Should I use ADO, LINQ, nHibernate or the Entity Framework?

I came across this blog post today that explains the differences between these data access technologies.  However, it does not give a definitive answer on when to use which technology.  That's because it depends on so many factors.  My advice is to keep it simple. 

Let me expand on the different technologies and provide some guidelines on when to use them:

Classic ADO.Net - In my opinion ADO.Net is a dying breed.  As a developer you need to know it for maintenance purposes, but any new features or products should be designed using LINQ or EF\nHibernate.  Some people might not agree with me here, but again this is my opinion.  The only caveat is to make sure the target environment supports the 3.5 Framework.  If the systems people will not let you install 3.5 on the server or end user's machine then LINQ and EF will not work. 

LINQ (LINQ to SQL) - As the blog post on this states, LINQ currently only supports SQL Server.  There are tons of open source projects that do LINQ to other things, but the only MS supported database backend is SQL Server.  For many of us, that is just fine.  If you know you need to support other DB platforms you can move on to EF\nHibernate now.  If you're pretty certain the only DB backend is going to be SQL Server then the decision between LINQ to SQL or EF\NHibernate comes down to architecture.  EF\nHibernate are full blown ORM tools, meaning they include many additional features (Inheritance, complex types, multiple data sources, etc) over and beyond what LINQ to SQL provides.  So, if you are using SQL Server and the application design is not overly advanced or complex.  I'd use LINQ to SQL.

EF\nHibernate - I lumped these two tools together because they are both ORM tools.  They provide support for many advanced and complex concepts in software design.  Using these advanced features is great if you are building a large enterprise, public facing or consumer use application.  However, for many applications these tools can be overkill and end up taking too much time to design.  That being said there is one thing that often gets overlooked, the fact that you can use these tools to do one to one mapping similar to the way LINQ to SQL does.  So, if you need to support mulitple DB backends, but you don't want to use the advanced features you can do so.

In summary, if you are building a simple application that is going to use SQL Server as the DB backend, use LINQ to SQL.  If you are building a simple application that needs to support a DB backend other than SQL Server, use EF or nHibernate and do one to one mapping between your entities and your DB tables.  If you are building a large application that requires some complex architecture, use EF or nHibernate.  Don't use ADO.Net for any new projects unless the target environment does not support the .Net 3.5 Framework.  However, I don't think it is necessary to go back and rip out all your ADO.Net code and replace it with something else.  Just be patient and use the new stuff with new projects.

Visual Studio 2008 SP1 Beta 1 Released

I know... I know... Many of you haven't installed the RTM version of VS 2008 yet.  These things are really starting to come out fast.  I guess Microsoft is finally realizing that most people don't install their products until after SP1 is released. 

This is still a beta, but it looks like it has some previews of some cool stuff.  It also looks like the install can mess up some of the other Beta\Alpha\RCs you have installed on top of VS 2008 currently.  So, check out these posts from the Scotts and actually read the release notes on this one before you install.

Scott Guthrie's Post

Scott Hanselman's Post

Posted in | 1 comments

Cloud Computing. Your Thoughts?

I just ran across this article out on Yahoo related to cloud computing and IBM and Google's plans for it.

http://news.yahoo.com/s/cmp/20080502/tc_cmp/207404265

Obviously I'm a huge Microsoft supporter.  I use Yahoo don't I.  If you don't use Yahoo, try it for awhile.  I recently decided to switch a couple weeks ago and I actually like it better than Google now.

Anyway, the article mentions they are planning to sell the use of Google Apps and Lotus Notes on this "cloud" network.  I'm just curious if anyone is using Google Apps or Lotus Notes currently?  If not would you switch from Office and Outlook if these apps where offered at a lower price through the cloud network?

Please submit you answers via comments.  I'd like to know what people think.

Posted in | 5 comments