The Big O/R Question

Thursday, January 1, 2009

Boy, I was really busy at the end of last year and I have been neglecting my blog, so I promise to try and be more deligent this year.

That being said, I have spent the past couple of months trying to figure out which O/R Mapper I should be using, and so far on a couple of small projects I worked on I used LINQ, nHibernate and have also been looking into the Entity Framework.  I very much like NHibernate, but to be honest, I was really enticed by LINQ's drag and drop wizzards and ease of coding. 

While using LINQ, one of the tasks I came across was I wanted to delete a record from the database just by passing a primary key.  Whaaa????  What do you mean LINQ does not have that functionality???  In order to delete a record I have to get the record first?  BUT I ALREADY HAVE THE RECORD!

There are some nice work arounds for this problem, and the one I used you can find on Omar Al Zabir's post.  He was even nice enough to provide the code.  Still you would think that LINQ would have this feature right out of the box.  So then after some more reading up on the subject, I came to find out that it looks like LINQ is going to die a slow death.  Both David Hayden and Oren Eini have posted it about it.  If no one is going to update LINQ then why use it?

So now I am wondering if I should use Entity Framework?  However there are some hurdles that are preventing me at the moment:

  • Right off the bat, one of things I find not so nice about this framework is it is so all encompassing.  I really do not want this framework forcing its way into all my other application layers. 
  • Why can't I pass it my own connection string at runtime? 
  • It seems to me there are a lot politics surrounding the framework which make me a bit uncomfortable about its future. 
  • Postings on its features (both in written and video form), at least for now, is a bit sparse.  There is much better documentation for the third party mappers such as NHibernate.

By the way, if you want to get started with nHibernate, I highly recommend the videos "The Summer of NHibernate".  Set a side some time though as there are a lot of hours of videos there.

So I guess for now I am going to look more at NHibernate and some of the other third party O/R Mappers out there and in the mean time keep my eye on Entity Framework and see what transpires.

comments powered by Disqus