Sunday, February 24, 2008

[Looking for opinions, links, articles and so on]

How do you implement LINQ to SQL in a classic 3-tiers (presentation, BAL, DAL) app?  A simple question, right?

So, if I create my LINQ to SQL DataAccess classes in a DAL, this is where the transport objects will reside.  I usually create a layer just for that so each layer can reference those objects.  Now, the presentation layer must reference the DAL directly.  Yuck!

OK, so let's return POCOs to the presentation layer instead.  Well, I'm losing all the change tracking stuff provided by LINQ to SQL.  Yuck!

What if I need to expose my BAL layer as a set of WCF services?  Well, I'm also losing the change tracking.  Yuck!

And what if I want to data bind my grid?  Using the designer, I need to point to the DataClasses sitting in the DAL.  Yuck!

OK, I'll lose the change tracking stuff.  Now I'll have to reload each record before saving it?  Yuck!

The way I see it, the only way you can possibly use LINQ to SQL is if you develop your app in a single layer.  I must be wrong.  I must miss something.  This can't be real.  Stunned!

 

Sunday, February 24, 2008 8:14:38 PM (Eastern Standard Time, UTC-05:00)  #    Comments [2]  | 
Monday, February 25, 2008 7:11:28 PM (Eastern Standard Time, UTC-05:00)
Entity Framework is your new best friend.

http://msdn2.microsoft.com/en-us/library/aa697427(VS.80).aspx
Monday, February 25, 2008 7:20:17 PM (Eastern Standard Time, UTC-05:00)
Nope, same problems.
Guy
All comments require the approval of the site owner before being displayed.
Name
E-mail
Home page

Comment (HTML not allowed)  

Enter the code shown (prevents robots):

Live Comment Preview

Theme design by Jelle Druyts