Monthly Archives: April 2007

Anders Hejlsberg and Me (or is that I?) on LINQ in Redmond Developer News

It’s not often that one sees their name right next to Anders‘ (especially considering that I’m a VB programmer :-)), but check out this LINQ article in the  current issue of Redmond Developer News. While the focus is Anders and this great technology he and others (and always with a nod to Alan Griver) are bringing to Visual Studio .NET, I was asked to give some developer perspective.

I’d also like to say that I wasn’t literally jumping up and down at PDC. 🙂

I know that I have had the same reaction when watching Scott Guthrie present on LINQ to SQL. I think I’m jumping up and down with joy, but truly my butt remained glued to the chair.

It was fun talking to Michael Schwarz about this, but I think I may have overwhelmed him with my geek technical perspective of LINQ from which he was trying to extract key points for dev managers. He seems to have done a great job.

Michael talked to another developer, VB guru Bill McCarthy who gave him a great analogy quoted at the end of the article.

LINQ to SQL vs. Entity Framework

A recent LINQ forum question asked about the differences between Linq to SQL and the Entity Framework.

This is the response that I wrote and thought I would surface it in my blog:

 Besides that Linq to SQL is only for SQL () one of the big differences is that the EDM is more flexible and more loosely coupled because of the 3-tiered model (conceptual layer, source schema and the mapping layer in between).  For example, you could have one conceptual layer and then multiple mapping layers that point to mulitple databases. In LINQ to SQL, your dbml properties are tightly bound directly to one particular field in a table.

While these are not in the March 2007 CTP, EDM is getting the ability to build views of the conceptual layer as well as to write stored procedures in the mapping layer. These are really cool features. I don’t believe you can do this with Linq to SQL, but a) I could be mistaken and b) that may be something that is forthcoming.

In addition to Linq to Entities, Entity SQL can be used to query entities. This can be either through the object services API or the Entity CLient (the one which gives you connections/commands and results in a dbDataReader). Entity SQL, while not as elegant as using the strongly typed LINQ, has the advantage of enabling dynamic queries, since you use a string to build a query, much like TSQL.

Both Linq to SQL and EDM allow inheritance and extending the code generated class with addtional partial classes. EF allows many to many relationships. I believe that LINQ to SQL will NOT be getting this by RTM.

These are just a few points and hardly exhaustive. But to me they are the low hanging fruit.