While I have been using Linq to Object for a couple of years now I had not investigated Linq to SQL up to this point.  I figured I would put together my take on this technology’s use.

Linq is a wonderful syntax for navigating an object graph without having to walk the graph object by object and member by member.  It is concise and compact but for someone who has never seen its syntax you would swear you went from reading English to obscure mathematic notation.  If you want to learn about the general structure of Linq go here.

In my opinion Linq to SQL feels like we are going back to datasets.  You can end up with code that is tightly bound to the database.  While you can abstract this by creating your own table classes instead of letting the SQL Class designer do it for you, but I don’t see most people doing that.  If you follow the tutorials your classes also directly reflect the structure of the database.  My thinking is that you are better off using one of the recognized ORM frameworks and if you happen to have a significant resulting object graph that you then use Linq to Object to navigate to a specific point in the graph.

In the end I plan to investigate this technology further to make sure that my initial observations hold true.

del.icio.us Tags: ,,