<?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: Lazy Loading is&#8230; well&#8230; lazy</title>
	<atom:link href="http://elegantcode.com/2009/11/12/lazy-loading-is-well-lazy/feed/" rel="self" type="application/rss+xml" />
	<link>http://elegantcode.com/2009/11/12/lazy-loading-is-well-lazy/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=lazy-loading-is-well-lazy</link>
	<description></description>
	<lastBuildDate>Tue, 07 Feb 2012 23:42:00 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.5</generator>
	<item>
		<title>By: iPhone lockscreen done right &#124; Road Monkeys</title>
		<link>http://elegantcode.com/2009/11/12/lazy-loading-is-well-lazy/comment-page-1/#comment-51220</link>
		<dc:creator>iPhone lockscreen done right &#124; Road Monkeys</dc:creator>
		<pubDate>Wed, 09 Dec 2009 15:42:16 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2009/11/12/lazy-loading-is-well-lazy/#comment-51220</guid>
		<description>[...] Elegant Code » Lazy Loading is… well… lazy [...]</description>
		<content:encoded><![CDATA[<p>[...] Elegant Code » Lazy Loading is… well… lazy [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dimitris</title>
		<link>http://elegantcode.com/2009/11/12/lazy-loading-is-well-lazy/comment-page-1/#comment-50317</link>
		<dc:creator>Dimitris</dc:creator>
		<pubDate>Sat, 14 Nov 2009 14:16:02 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2009/11/12/lazy-loading-is-well-lazy/#comment-50317</guid>
		<description>Lazy loading is largely used in conjunction with the &quot;Open Session in View&quot; pattern. This is unfortunate, IMHO, because it leads to (ab)using database access in the view layer. 

The more architectural correct approach is to have the session (thus transaction) closed by the time your model classes hits the view. Any necessary mapped properties should be initialized at the service layer. This, however can lead to substantial more complexity so people usually prefer the &quot;quick &#039;n dirty&quot; way.</description>
		<content:encoded><![CDATA[<p>Lazy loading is largely used in conjunction with the &#8220;Open Session in View&#8221; pattern. This is unfortunate, IMHO, because it leads to (ab)using database access in the view layer. </p>
<p>The more architectural correct approach is to have the session (thus transaction) closed by the time your model classes hits the view. Any necessary mapped properties should be initialized at the service layer. This, however can lead to substantial more complexity so people usually prefer the &#8220;quick &#8216;n dirty&#8221; way.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jarod Ferguson</title>
		<link>http://elegantcode.com/2009/11/12/lazy-loading-is-well-lazy/comment-page-1/#comment-50300</link>
		<dc:creator>Jarod Ferguson</dc:creator>
		<pubDate>Fri, 13 Nov 2009 22:53:39 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2009/11/12/lazy-loading-is-well-lazy/#comment-50300</guid>
		<description>I agree with you 100%, bad design, in a contrived example. Ideally in this scenario the necessary data could be &#039;rolled up&#039; into a value on the product, as in the VendorName. Except that is *much* harder to change a production schema and its data, than just walking the graph an lazy loading :)

That is the point of this post, in my experience these types of scenarios come up a lot, and the easiness of Lazy Loading tends to be detrimental over time.

That is why I choose to be explicit about my data access.

Thanks for your comments Sam!</description>
		<content:encoded><![CDATA[<p>I agree with you 100%, bad design, in a contrived example. Ideally in this scenario the necessary data could be &#8216;rolled up&#8217; into a value on the product, as in the VendorName. Except that is *much* harder to change a production schema and its data, than just walking the graph an lazy loading <img src='http://elegantcode.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>That is the point of this post, in my experience these types of scenarios come up a lot, and the easiness of Lazy Loading tends to be detrimental over time.</p>
<p>That is why I choose to be explicit about my data access.</p>
<p>Thanks for your comments Sam!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sam</title>
		<link>http://elegantcode.com/2009/11/12/lazy-loading-is-well-lazy/comment-page-1/#comment-50299</link>
		<dc:creator>sam</dc:creator>
		<pubDate>Fri, 13 Nov 2009 22:42:13 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2009/11/12/lazy-loading-is-well-lazy/#comment-50299</guid>
		<description>Right, but it&#039;s hard to say lazy is lazy (i.e. bad) all the time.  
What you are describing is a situation where you need both the root&#039;s data and child.child.child.property data at the same time.  Many times you&#039;d want child object&#039;s data at different time, such as in a drill-down scenario.  For example, listing 50 orders on a page, but only showing the product image(s) if the user selects an order&#039;s product detail.  You probably wouldn&#039;t want to grab a product&#039;s image data for a list of orders screen unless you know the user is going to need it (later).  

I think needing the rootaggregate.child.child.child.propertyvalue in a list of those roots *may* be indicative of unusual design.</description>
		<content:encoded><![CDATA[<p>Right, but it&#8217;s hard to say lazy is lazy (i.e. bad) all the time.<br />
What you are describing is a situation where you need both the root&#8217;s data and child.child.child.property data at the same time.  Many times you&#8217;d want child object&#8217;s data at different time, such as in a drill-down scenario.  For example, listing 50 orders on a page, but only showing the product image(s) if the user selects an order&#8217;s product detail.  You probably wouldn&#8217;t want to grab a product&#8217;s image data for a list of orders screen unless you know the user is going to need it (later).  </p>
<p>I think needing the rootaggregate.child.child.child.propertyvalue in a list of those roots *may* be indicative of unusual design.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jarod Ferguson</title>
		<link>http://elegantcode.com/2009/11/12/lazy-loading-is-well-lazy/comment-page-1/#comment-50296</link>
		<dc:creator>Jarod Ferguson</dc:creator>
		<pubDate>Fri, 13 Nov 2009 20:39:15 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2009/11/12/lazy-loading-is-well-lazy/#comment-50296</guid>
		<description>Sam, If I eager load &quot;Order.LineItem.Product.Catalog.Vendor&quot; I can get all the data in one query, vs potentially many N + 1. (EF query.Include() or NH query.Expand())

Also, now that it is in one query, there may also be performance tuning benefits, such as indexing different columns.</description>
		<content:encoded><![CDATA[<p>Sam, If I eager load &#8220;Order.LineItem.Product.Catalog.Vendor&#8221; I can get all the data in one query, vs potentially many N + 1. (EF query.Include() or NH query.Expand())</p>
<p>Also, now that it is in one query, there may also be performance tuning benefits, such as indexing different columns.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sam</title>
		<link>http://elegantcode.com/2009/11/12/lazy-loading-is-well-lazy/comment-page-1/#comment-50291</link>
		<dc:creator>sam</dc:creator>
		<pubDate>Fri, 13 Nov 2009 16:37:51 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2009/11/12/lazy-loading-is-well-lazy/#comment-50291</guid>
		<description>I&#039;m confused.  In your example it doesn&#039;t look like eager loading would make it any better.</description>
		<content:encoded><![CDATA[<p>I&#8217;m confused.  In your example it doesn&#8217;t look like eager loading would make it any better.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Elegant Code &#187; Tips for ORM Data Access</title>
		<link>http://elegantcode.com/2009/11/12/lazy-loading-is-well-lazy/comment-page-1/#comment-50273</link>
		<dc:creator>Elegant Code &#187; Tips for ORM Data Access</dc:creator>
		<pubDate>Thu, 12 Nov 2009 22:32:28 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2009/11/12/lazy-loading-is-well-lazy/#comment-50273</guid>
		<description>[...] my last post I took a stab at Lazy Loading data access, and pointed out a concrete example of why I don’t like it. As with anything their are [...]</description>
		<content:encoded><![CDATA[<p>[...] my last post I took a stab at Lazy Loading data access, and pointed out a concrete example of why I don’t like it. As with anything their are [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>

