<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Do you really need a data access layer with LINQ?</title>
	<atom:link href="http://www.ytechie.com/2008/05/do-you-really-need-a-data-access-layer-with-linq.html/feed" rel="self" type="application/rss+xml" />
	<link>http://www.ytechie.com/2008/05/do-you-really-need-a-data-access-layer-with-linq.html</link>
	<description>Productive software development using ASP.NET, C#, Adobe Flex, and other technologies and tools.</description>
	<lastBuildDate>Fri, 03 Feb 2012 08:52:23 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Alwin Goh</title>
		<link>http://www.ytechie.com/2008/05/do-you-really-need-a-data-access-layer-with-linq.html/comment-page-1#comment-1827</link>
		<dc:creator>Alwin Goh</dc:creator>
		<pubDate>Sat, 12 Feb 2011 01:58:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.ytechie.com/2008/05/do-you-really-need-a-data-access-layer-with-linq.html#comment-1827</guid>
		<description>Hi, though its been a while since you first posted this, I&#039;d like to say that I have the same conclusion as you. While I deem that both the UI and Biz layers are still there, the dataaccess layer is now different, though not redundant. What used to be lots of SQL statements in the DAL is now superceded by the LINQ (to whatever) commands which pool and generate to underlying native commands. The level of reusability afforded by LINQ is not something easily achievable by a traditional DAL (why not try combining different DAL methods to achieve 1 unified operation, it will be something short of perfect...), unless you had the skill to achieve the same kind of command reuse possible with LINQ, which is beyond the time (maybe not brains) of most people. With LINQ, I think the data access layer now consists of 1) the provider, 2）the context/entities, 3) And maybe any extra data definitions (physical, logical), mappings... plus a global connection string setting somewhere.
DALs are not gone, just changed, and LINQ just looks like SQL, it is not SQL - it is a general purpose query language for getting things, it is a very important improvement. Hence, LINQ can be used in UI or Biz layers, depending on how you use it.</description>
		<content:encoded><![CDATA[<p>Hi, though its been a while since you first posted this, I&#8217;d like to say that I have the same conclusion as you. While I deem that both the UI and Biz layers are still there, the dataaccess layer is now different, though not redundant. What used to be lots of SQL statements in the DAL is now superceded by the LINQ (to whatever) commands which pool and generate to underlying native commands. The level of reusability afforded by LINQ is not something easily achievable by a traditional DAL (why not try combining different DAL methods to achieve 1 unified operation, it will be something short of perfect&#8230;), unless you had the skill to achieve the same kind of command reuse possible with LINQ, which is beyond the time (maybe not brains) of most people. With LINQ, I think the data access layer now consists of 1) the provider, 2）the context/entities, 3) And maybe any extra data definitions (physical, logical), mappings&#8230; plus a global connection string setting somewhere.<br />
DALs are not gone, just changed, and LINQ just looks like SQL, it is not SQL &#8211; it is a general purpose query language for getting things, it is a very important improvement. Hence, LINQ can be used in UI or Biz layers, depending on how you use it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Abubakar</title>
		<link>http://www.ytechie.com/2008/05/do-you-really-need-a-data-access-layer-with-linq.html/comment-page-1#comment-1742</link>
		<dc:creator>Abubakar</dc:creator>
		<pubDate>Fri, 09 Jul 2010 05:44:40 +0000</pubDate>
		<guid isPermaLink="false">http://www.ytechie.com/2008/05/do-you-really-need-a-data-access-layer-with-linq.html#comment-1742</guid>
		<description>this is good technique About the Linq Which use in asp.net3.5 That is good visual Studion Becasue
this is user friendly</description>
		<content:encoded><![CDATA[<p>this is good technique About the Linq Which use in asp.net3.5 That is good visual Studion Becasue<br />
this is user friendly</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Carlos ABS</title>
		<link>http://www.ytechie.com/2008/05/do-you-really-need-a-data-access-layer-with-linq.html/comment-page-1#comment-1568</link>
		<dc:creator>Carlos ABS</dc:creator>
		<pubDate>Fri, 14 Aug 2009 14:15:14 +0000</pubDate>
		<guid isPermaLink="false">http://www.ytechie.com/2008/05/do-you-really-need-a-data-access-layer-with-linq.html#comment-1568</guid>
		<description>Hi!

I&#039;m developing a brand nem e-commerce website and had the same insight.

I was developing in the &quot;old way&quot;:

U.I. -&gt; B.O.L. -&gt; D.A.L -&gt; Stored procedures

Then i was introduced to LINQ and the more i used it, the more i realized that my DAL, BOL and stored procedures, IN THIS CASE, are useless.

I&#039;m not 100% sure about this, but i&#039;m planning to remove all those &quot;useless&quot; and work just with LINQ by now.

I used a third part objects/procedures generator but LINQ to SQL is doing the &quot;dirt work&quot; for me now.</description>
		<content:encoded><![CDATA[<p>Hi!</p>
<p>I&#8217;m developing a brand nem e-commerce website and had the same insight.</p>
<p>I was developing in the &#8220;old way&#8221;:</p>
<p>U.I. -&gt; B.O.L. -&gt; D.A.L -&gt; Stored procedures</p>
<p>Then i was introduced to LINQ and the more i used it, the more i realized that my DAL, BOL and stored procedures, IN THIS CASE, are useless.</p>
<p>I&#8217;m not 100% sure about this, but i&#8217;m planning to remove all those &#8220;useless&#8221; and work just with LINQ by now.</p>
<p>I used a third part objects/procedures generator but LINQ to SQL is doing the &#8220;dirt work&#8221; for me now.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Karl Kemerait</title>
		<link>http://www.ytechie.com/2008/05/do-you-really-need-a-data-access-layer-with-linq.html/comment-page-1#comment-1289</link>
		<dc:creator>Karl Kemerait</dc:creator>
		<pubDate>Wed, 14 Jan 2009 13:43:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.ytechie.com/2008/05/do-you-really-need-a-data-access-layer-with-linq.html#comment-1289</guid>
		<description>Nice thought process, in general I agree with you, I would even sugest that we could go further. I tend to think the most of the &quot;best practices&quot; that follow today are designed to be &quot;best proactices&quot; for applications that are much larger than the one we typically work on. I think it&#039;s time to look at a second set of &quot;best practices&quot; that more closely matches our daily tasks and priorities.

http://designlunacy.blogspot.com

for my latest rant on &quot;involving users in design&quot;</description>
		<content:encoded><![CDATA[<p>Nice thought process, in general I agree with you, I would even sugest that we could go further. I tend to think the most of the &#8220;best practices&#8221; that follow today are designed to be &#8220;best proactices&#8221; for applications that are much larger than the one we typically work on. I think it&#8217;s time to look at a second set of &#8220;best practices&#8221; that more closely matches our daily tasks and priorities.</p>
<p><a href="http://designlunacy.blogspot.com" rel="nofollow" onclick="pageTracker._trackPageview('/outgoing/designlunacy.blogspot.com?referer=');">http://designlunacy.blogspot.com</a></p>
<p>for my latest rant on &#8220;involving users in design&#8221;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dew Drop - May 8, 2008 &#124; Alvin Ashcraft's Morning Dew</title>
		<link>http://www.ytechie.com/2008/05/do-you-really-need-a-data-access-layer-with-linq.html/comment-page-1#comment-245</link>
		<dc:creator>Dew Drop - May 8, 2008 &#124; Alvin Ashcraft's Morning Dew</dc:creator>
		<pubDate>Thu, 08 May 2008 13:16:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.ytechie.com/2008/05/do-you-really-need-a-data-access-layer-with-linq.html#comment-245</guid>
		<description>[...] Do You Really Need a Data Access Layer with LINQ? (Jason Young) [...]</description>
		<content:encoded><![CDATA[<p>[...] Do You Really Need a Data Access Layer with LINQ? (Jason Young) [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: teedyay</title>
		<link>http://www.ytechie.com/2008/05/do-you-really-need-a-data-access-layer-with-linq.html/comment-page-1#comment-243</link>
		<dc:creator>teedyay</dc:creator>
		<pubDate>Thu, 08 May 2008 09:49:08 +0000</pubDate>
		<guid isPermaLink="false">http://www.ytechie.com/2008/05/do-you-really-need-a-data-access-layer-with-linq.html#comment-243</guid>
		<description>Mmm, thanks for the popcorn, Will! ;-)

There&#039;s some quite strong opinions on this page, but I can see where you&#039;re coming from: LINQ makes it so damn easy to write queries in the code behind your page, but something makes me feel a little uncomfortable doing that.

Just lately I&#039;ve been trying to put most (all?) of the DB-accessing LINQ queries into the non-generated half of my DataContext class, just so it&#039;s all together in one place, giving me my data access layer.

This is fine for encapsulation, but feels a bit like over-engineering when it&#039;s a simple query I only use on one page.

LINQ&#039;s DataContext has been quite a paradigm shift for me in terms of how I use ORM. For me at least, the jury&#039;s still out on issues like this.</description>
		<content:encoded><![CDATA[<p>Mmm, thanks for the popcorn, Will! <img src='http://www.ytechie.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>There&#8217;s some quite strong opinions on this page, but I can see where you&#8217;re coming from: LINQ makes it so damn easy to write queries in the code behind your page, but something makes me feel a little uncomfortable doing that.</p>
<p>Just lately I&#8217;ve been trying to put most (all?) of the DB-accessing LINQ queries into the non-generated half of my DataContext class, just so it&#8217;s all together in one place, giving me my data access layer.</p>
<p>This is fine for encapsulation, but feels a bit like over-engineering when it&#8217;s a simple query I only use on one page.</p>
<p>LINQ&#8217;s DataContext has been quite a paradigm shift for me in terms of how I use ORM. For me at least, the jury&#8217;s still out on issues like this.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: superjason</title>
		<link>http://www.ytechie.com/2008/05/do-you-really-need-a-data-access-layer-with-linq.html/comment-page-1#comment-242</link>
		<dc:creator>superjason</dc:creator>
		<pubDate>Thu, 08 May 2008 01:35:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.ytechie.com/2008/05/do-you-really-need-a-data-access-layer-with-linq.html#comment-242</guid>
		<description>&quot;Eventually you’ll come to the realization that common linq queries belong in a common class accessed by all pages&quot; - I agree, but what I&#039;ve seen, at least on the last site, common queries are more rare than I would like. Each page usually has different requirements. When I&#039;m writing code, I&#039;m very conscious of rewriting the same functionality. When that happens, of course I&#039;m going to try to re-use my code.

Chad, I agree. I think I&#039;ve unsuccessfully conveyed the situation that I&#039;ve run into. I&#039;ve tried to apply my background in large application development, to individual pages with their own unique functionality. I don&#039;t regret insulting people, since I was including myself in that group. I&#039;m simply suggesting that a hard and fast rule of trying desperately to separate out DAL logic might not reap the benefits we would expect. 

In the site I just created, I had all the layers, and they were completely separated. I was able to test any layer regardless of the other layers. The site is reliable thanks to 700 unit tests, but at the expense of having 10x as much code to maintain. Am I really better off? I&#039;m not so sure!

Honestly, I would have rather saved all of that time, and spent it on the critical pages. For example, I would have liked to had a full MVC unit testable checkout process.</description>
		<content:encoded><![CDATA[<p>&#8220;Eventually you’ll come to the realization that common linq queries belong in a common class accessed by all pages&#8221; &#8211; I agree, but what I&#8217;ve seen, at least on the last site, common queries are more rare than I would like. Each page usually has different requirements. When I&#8217;m writing code, I&#8217;m very conscious of rewriting the same functionality. When that happens, of course I&#8217;m going to try to re-use my code.</p>
<p>Chad, I agree. I think I&#8217;ve unsuccessfully conveyed the situation that I&#8217;ve run into. I&#8217;ve tried to apply my background in large application development, to individual pages with their own unique functionality. I don&#8217;t regret insulting people, since I was including myself in that group. I&#8217;m simply suggesting that a hard and fast rule of trying desperately to separate out DAL logic might not reap the benefits we would expect. </p>
<p>In the site I just created, I had all the layers, and they were completely separated. I was able to test any layer regardless of the other layers. The site is reliable thanks to 700 unit tests, but at the expense of having 10x as much code to maintain. Am I really better off? I&#8217;m not so sure!</p>
<p>Honestly, I would have rather saved all of that time, and spent it on the critical pages. For example, I would have liked to had a full MVC unit testable checkout process.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chad Myers</title>
		<link>http://www.ytechie.com/2008/05/do-you-really-need-a-data-access-layer-with-linq.html/comment-page-1#comment-241</link>
		<dc:creator>Chad Myers</dc:creator>
		<pubDate>Wed, 07 May 2008 23:57:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.ytechie.com/2008/05/do-you-really-need-a-data-access-layer-with-linq.html#comment-241</guid>
		<description>@superjason: Stop insulting people (re: hammer/nail) and try to consider why the &#039;db.Orders&#039; might be a problem if you ever wanted to use that code against something other than a database (i.e. test data). If you&#039;re happy with tightly binding all your code to your database and sure that you&#039;ll never re-use that code for anything else, then why do any layers and just have one solid layer and put everything in the code behind or directly in the view?</description>
		<content:encoded><![CDATA[<p>@superjason: Stop insulting people (re: hammer/nail) and try to consider why the &#8216;db.Orders&#8217; might be a problem if you ever wanted to use that code against something other than a database (i.e. test data). If you&#8217;re happy with tightly binding all your code to your database and sure that you&#8217;ll never re-use that code for anything else, then why do any layers and just have one solid layer and put everything in the code behind or directly in the view?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: logicalmind</title>
		<link>http://www.ytechie.com/2008/05/do-you-really-need-a-data-access-layer-with-linq.html/comment-page-1#comment-240</link>
		<dc:creator>logicalmind</dc:creator>
		<pubDate>Wed, 07 May 2008 22:17:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.ytechie.com/2008/05/do-you-really-need-a-data-access-layer-with-linq.html#comment-240</guid>
		<description>It all depends on project size. If you are a single developer writing all the code and all the pages then of course it&#039;s going to be easiest for you to write the least amount of code. Once you introduce more developers to the project that starts to fall apart. 

Are you suggesting that whoever is writing a page determine what linq queries they use and just write those in their page? Eventually you&#039;ll come to the realization that common linq queries belong in a common class accessed by all pages. Separate people can write these separate layers as would be the case in projects with more than one developer. Once you do this you&#039;re back to where you started except you&#039;ve replaced nhibernate data access layer with linq for sql data access layer.</description>
		<content:encoded><![CDATA[<p>It all depends on project size. If you are a single developer writing all the code and all the pages then of course it&#8217;s going to be easiest for you to write the least amount of code. Once you introduce more developers to the project that starts to fall apart. </p>
<p>Are you suggesting that whoever is writing a page determine what linq queries they use and just write those in their page? Eventually you&#8217;ll come to the realization that common linq queries belong in a common class accessed by all pages. Separate people can write these separate layers as would be the case in projects with more than one developer. Once you do this you&#8217;re back to where you started except you&#8217;ve replaced nhibernate data access layer with linq for sql data access layer.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: superjason</title>
		<link>http://www.ytechie.com/2008/05/do-you-really-need-a-data-access-layer-with-linq.html/comment-page-1#comment-239</link>
		<dc:creator>superjason</dc:creator>
		<pubDate>Wed, 07 May 2008 21:47:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.ytechie.com/2008/05/do-you-really-need-a-data-access-layer-with-linq.html#comment-239</guid>
		<description>Our business objects match our database. It was written from the ground up that way. We use OR-mappers exclusively.

Code changes will trigger compile errors (when using Linq), and we&#039;ll know where to make the changes.

I&#039;ll check out the Linq screencast you mentioned. I would like to see a good ecommerce example.</description>
		<content:encoded><![CDATA[<p>Our business objects match our database. It was written from the ground up that way. We use OR-mappers exclusively.</p>
<p>Code changes will trigger compile errors (when using Linq), and we&#8217;ll know where to make the changes.</p>
<p>I&#8217;ll check out the Linq screencast you mentioned. I would like to see a good ecommerce example.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

