<?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: Build Your Own Data Access Layer: Lazy Loading</title> <atom:link href="http://davybrion.com/blog/2009/08/build-your-own-data-access-layer-lazy-loading/feed/" rel="self" type="application/rss+xml" /><link>http://davybrion.com/blog/2009/08/build-your-own-data-access-layer-lazy-loading/</link> <description>inquisitive: adjective. given to inquiry, research, or asking questions; eager for knowledge; intellectually curious</description> <lastBuildDate>Sun, 20 May 2012 21:55:00 +0000</lastBuildDate> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.2</generator> <item><title>By: upul</title><link>http://davybrion.com/blog/2009/08/build-your-own-data-access-layer-lazy-loading/comment-page-1/#comment-101877</link> <dc:creator>upul</dc:creator> <pubDate>Thu, 27 Oct 2011 10:01:00 +0000</pubDate> <guid
isPermaLink="false">http://davybrion.com/blog/?p=1528#comment-101877</guid> <description>var proxy = new ProxyGenerator().CreateClassProxy(referenceInfo.ReferenceType, new[] { new LazyLoadingInterceptor(tableInfo, session) });</description> <content:encoded><![CDATA[<p>var proxy = new ProxyGenerator().CreateClassProxy(referenceInfo.ReferenceType, new[] { new LazyLoadingInterceptor(tableInfo, session) });</p> ]]></content:encoded> </item> <item><title>By: upul</title><link>http://davybrion.com/blog/2009/08/build-your-own-data-access-layer-lazy-loading/comment-page-1/#comment-101876</link> <dc:creator>upul</dc:creator> <pubDate>Thu, 27 Oct 2011 10:00:00 +0000</pubDate> <guid
isPermaLink="false">http://davybrion.com/blog/?p=1528#comment-101876</guid> <description>var proxy = new ProxyGenerator().CreateClassProxy(referenceInfo.ReferenceType, new[] { new LazyLoadingInterceptor(tableInfo, session) });</description> <content:encoded><![CDATA[<p>var proxy = new ProxyGenerator().CreateClassProxy(referenceInfo.ReferenceType, new[] { new LazyLoadingInterceptor(tableInfo, session) });</p> ]]></content:encoded> </item> <item><title>By: Davy Brion</title><link>http://davybrion.com/blog/2009/08/build-your-own-data-access-layer-lazy-loading/comment-page-1/#comment-24789</link> <dc:creator>Davy Brion</dc:creator> <pubDate>Wed, 13 Jan 2010 09:45:21 +0000</pubDate> <guid
isPermaLink="false">http://davybrion.com/blog/?p=1528#comment-24789</guid> <description>@Nagarajanthe session is explained in this post:
http://davybrion.com/blog/2009/08/build-your-own-data-access-layer-bringing-it-all-together/</description> <content:encoded><![CDATA[<p>@Nagarajan</p><p>the session is explained in this post:<br
/> <a
href="http://davybrion.com/blog/2009/08/build-your-own-data-access-layer-bringing-it-all-together/" rel="nofollow">http://davybrion.com/blog/2009/08/build-your-own-data-access-layer-bringing-it-all-together/</a></p> ]]></content:encoded> </item> <item><title>By: Nagarajan</title><link>http://davybrion.com/blog/2009/08/build-your-own-data-access-layer-lazy-loading/comment-page-1/#comment-24774</link> <dc:creator>Nagarajan</dc:creator> <pubDate>Wed, 13 Jan 2010 08:17:30 +0000</pubDate> <guid
isPermaLink="false">http://davybrion.com/blog/?p=1528#comment-24774</guid> <description>Hi,In class EntityHydrater, there is a method called CreateProxy and it uses &quot;session&quot; object in LazyLoadingInterceptor. where it comes from?.Regards,
Nagarajan.</description> <content:encoded><![CDATA[<p>Hi,</p><p> In class EntityHydrater, there is a method called CreateProxy and it uses &#8220;session&#8221; object in LazyLoadingInterceptor. where it comes from?.</p><p>Regards,<br
/> Nagarajan.</p> ]]></content:encoded> </item> <item><title>By: Davy Brion</title><link>http://davybrion.com/blog/2009/08/build-your-own-data-access-layer-lazy-loading/comment-page-1/#comment-22669</link> <dc:creator>Davy Brion</dc:creator> <pubDate>Thu, 08 Oct 2009 13:00:25 +0000</pubDate> <guid
isPermaLink="false">http://davybrion.com/blog/?p=1528#comment-22669</guid> <description>it hasn&#039;t been deployed in production yet, but so far we haven&#039;t had problems with iti&#039;m sure some problems will come up sooner or later though :p</description> <content:encoded><![CDATA[<p>it hasn&#8217;t been deployed in production yet, but so far we haven&#8217;t had problems with it</p><p>i&#8217;m sure some problems will come up sooner or later though :p</p> ]]></content:encoded> </item> <item><title>By: Gareth</title><link>http://davybrion.com/blog/2009/08/build-your-own-data-access-layer-lazy-loading/comment-page-1/#comment-22668</link> <dc:creator>Gareth</dc:creator> <pubDate>Thu, 08 Oct 2009 12:54:05 +0000</pubDate> <guid
isPermaLink="false">http://davybrion.com/blog/?p=1528#comment-22668</guid> <description>Often the best reason I find ;)I&#039;m building something using a similar model and was concerned in case there were issues accessing the attributes in that scenario.BTW how is the code behaving in the wild?</description> <content:encoded><![CDATA[<p>Often the best reason I find <img
src='http://d18sni7re4ly7f.cloudfront.net/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /></p><p>I&#8217;m building something using a similar model and was concerned in case there were issues accessing the attributes in that scenario.</p><p>BTW how is the code behaving in the wild?</p> ]]></content:encoded> </item> <item><title>By: Davy Brion</title><link>http://davybrion.com/blog/2009/08/build-your-own-data-access-layer-lazy-loading/comment-page-1/#comment-22667</link> <dc:creator>Davy Brion</dc:creator> <pubDate>Thu, 08 Oct 2009 11:26:32 +0000</pubDate> <guid
isPermaLink="false">http://davybrion.com/blog/?p=1528#comment-22667</guid> <description>not really a specific reason for that, other than that was the first thing that came to my mind ;)</description> <content:encoded><![CDATA[<p>not really a specific reason for that, other than that was the first thing that came to my mind <img
src='http://d18sni7re4ly7f.cloudfront.net/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /></p> ]]></content:encoded> </item> <item><title>By: Gareth</title><link>http://davybrion.com/blog/2009/08/build-your-own-data-access-layer-lazy-loading/comment-page-1/#comment-22666</link> <dc:creator>Gareth</dc:creator> <pubDate>Thu, 08 Oct 2009 10:34:27 +0000</pubDate> <guid
isPermaLink="false">http://davybrion.com/blog/?p=1528#comment-22666</guid> <description>Great series of posts Davy!Question regarding the LazyLoadingInterceptor - is there a specific reason why you check for the primary key using the property name rather than looking for the primary key attribute on the invocation method?Gareth</description> <content:encoded><![CDATA[<p>Great series of posts Davy!</p><p>Question regarding the LazyLoadingInterceptor &#8211; is there a specific reason why you check for the primary key using the property name rather than looking for the primary key attribute on the invocation method?</p><p>Gareth</p> ]]></content:encoded> </item> <item><title>By: Krzysztof Koźmic</title><link>http://davybrion.com/blog/2009/08/build-your-own-data-access-layer-lazy-loading/comment-page-1/#comment-22362</link> <dc:creator>Krzysztof Koźmic</dc:creator> <pubDate>Fri, 28 Aug 2009 12:08:58 +0000</pubDate> <guid
isPermaLink="false">http://davybrion.com/blog/?p=1528#comment-22362</guid> <description>Davy,from the DP perspective, you could clean things up a little bit (and get some performance improvement) if you used IProxyGenerationHook and/or IInterceptorSelector to control which members to override/intercept.Krzysztof</description> <content:encoded><![CDATA[<p>Davy,</p><p>from the DP perspective, you could clean things up a little bit (and get some performance improvement) if you used IProxyGenerationHook and/or IInterceptorSelector to control which members to override/intercept.</p><p>Krzysztof</p> ]]></content:encoded> </item> <item><title>By: kilfour</title><link>http://davybrion.com/blog/2009/08/build-your-own-data-access-layer-lazy-loading/comment-page-1/#comment-22361</link> <dc:creator>kilfour</dc:creator> <pubDate>Fri, 28 Aug 2009 11:25:07 +0000</pubDate> <guid
isPermaLink="false">http://davybrion.com/blog/?p=1528#comment-22361</guid> <description>Most custom DAL&#039;s are something that have me waking up screaming in the middle of the night, during the period I&#039;m confronted with them. Still a lot of developers insist on writing one, instead of using a mature solution that&#039;s allready out there. Great job with this one though, and an even better job of putting the effort into perspective.
Just one of many examples why you better not write your own DAL, and if you do, sit down and think about it first.
Introducing a new concept Immutable Lazy Loading :
&lt;code&gt;
public Product.Product Product
{
get
{
if (_Product == null)
{
_Product = DAOFactory.ProductFactory.RetrieveProductByProductID(ProductID);
}
else
{
if (!(_Product.Id.Equals(ProductID)))
{
_Product = DAOFactory.ProductFactory.RetrieveProductByProductID(ProductID);
}
}
return _Product;
}
set
{
_Product = value;
}
}
&lt;/code&gt;
Millions more where that came from.</description> <content:encoded><![CDATA[<p>Most custom DAL&#8217;s are something that have me waking up screaming in the middle of the night, during the period I&#8217;m confronted with them. Still a lot of developers insist on writing one, instead of using a mature solution that&#8217;s allready out there. Great job with this one though, and an even better job of putting the effort into perspective.<br
/> Just one of many examples why you better not write your own DAL, and if you do, sit down and think about it first.<br
/> Introducing a new concept Immutable Lazy Loading :<br
/> <code><br
/> public Product.Product Product<br
/> {<br
/> get<br
/> {<br
/> if (_Product == null)<br
/> {<br
/> _Product = DAOFactory.ProductFactory.RetrieveProductByProductID(ProductID);<br
/> }<br
/> else<br
/> {<br
/> if (!(_Product.Id.Equals(ProductID)))<br
/> {<br
/> _Product = DAOFactory.ProductFactory.RetrieveProductByProductID(ProductID);<br
/> }<br
/> }<br
/> return _Product;<br
/> }<br
/> set<br
/> {<br
/> _Product = value;<br
/> }<br
/> }<br
/> </code><br
/> Millions more where that came from.</p> ]]></content:encoded> </item> <item><title>By: Steve</title><link>http://davybrion.com/blog/2009/08/build-your-own-data-access-layer-lazy-loading/comment-page-1/#comment-22360</link> <dc:creator>Steve</dc:creator> <pubDate>Fri, 28 Aug 2009 11:21:17 +0000</pubDate> <guid
isPermaLink="false">http://davybrion.com/blog/?p=1528#comment-22360</guid> <description>Thanks.  I&#039;m looking forward to Session and UnitOfWork :)</description> <content:encoded><![CDATA[<p>Thanks.  I&#8217;m looking forward to Session and UnitOfWork <img
src='http://d18sni7re4ly7f.cloudfront.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p> ]]></content:encoded> </item> <item><title>By: Reflective Perspective - Chris Alcock &#187; The Morning Brew #422</title><link>http://davybrion.com/blog/2009/08/build-your-own-data-access-layer-lazy-loading/comment-page-1/#comment-22359</link> <dc:creator>Reflective Perspective - Chris Alcock &#187; The Morning Brew #422</dc:creator> <pubDate>Fri, 28 Aug 2009 07:34:57 +0000</pubDate> <guid
isPermaLink="false">http://davybrion.com/blog/?p=1528#comment-22359</guid> <description>[...] Build Your Own Data Access Layer: Lazy Loading - Davy Brion continues his series of posts on building a custom DAL, looking at how Lazy Load of entities can be achived. In A guide into OR/M implementation challenges: Lazy loading Ayende follows on from Davy&#8217;s post with a look at how NHibernate handles the Lazy Load [...]</description> <content:encoded><![CDATA[<p>[...] Build Your Own Data Access Layer: Lazy Loading &#8211; Davy Brion continues his series of posts on building a custom DAL, looking at how Lazy Load of entities can be achived. In A guide into OR/M implementation challenges: Lazy loading Ayende follows on from Davy&#8217;s post with a look at how NHibernate handles the Lazy Load [...]</p> ]]></content:encoded> </item> <item><title>By: Davy Brion</title><link>http://davybrion.com/blog/2009/08/build-your-own-data-access-layer-lazy-loading/comment-page-1/#comment-22358</link> <dc:creator>Davy Brion</dc:creator> <pubDate>Thu, 27 Aug 2009 21:02:06 +0000</pubDate> <guid
isPermaLink="false">http://davybrion.com/blog/?p=1528#comment-22358</guid> <description>that&#039;s a good question... i certainly wouldn&#039;t try to write a proxy generator, that&#039;s for sure :Pif i wasn&#039;t allowed to use DynamicProxy in this DAL, i&#039;d probably try to enable lazy-loading by wrapping reference properties in something which only provides a .Value property and do the lazy loading when the Value property is accessed (like how IFutureValue in NHibernate works).  The only way to access the reference property would be through the Value property so the calling code would be oblivious to the fact, though it would be uglier than just using a property.you&#039;d basically get something like invoice.Customer.Value in your code, instead of just invoice.Customer</description> <content:encoded><![CDATA[<p>that&#8217;s a good question&#8230; i certainly wouldn&#8217;t try to write a proxy generator, that&#8217;s for sure <img
src='http://d18sni7re4ly7f.cloudfront.net/blog/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /></p><p>if i wasn&#8217;t allowed to use DynamicProxy in this DAL, i&#8217;d probably try to enable lazy-loading by wrapping reference properties in something which only provides a .Value property and do the lazy loading when the Value property is accessed (like how IFutureValue in NHibernate works).  The only way to access the reference property would be through the Value property so the calling code would be oblivious to the fact, though it would be uglier than just using a property.</p><p>you&#8217;d basically get something like invoice.Customer.Value in your code, instead of just invoice.Customer</p> ]]></content:encoded> </item> <item><title>By: Bertrand Le Roy</title><link>http://davybrion.com/blog/2009/08/build-your-own-data-access-layer-lazy-loading/comment-page-1/#comment-22357</link> <dc:creator>Bertrand Le Roy</dc:creator> <pubDate>Thu, 27 Aug 2009 20:55:12 +0000</pubDate> <guid
isPermaLink="false">http://davybrion.com/blog/?p=1528#comment-22357</guid> <description>I was going to say the same thing as Ryan but he beat me to it. Thanks to your answer I understand why Castle is OK on that specific project, but what would you do if it wasn&#039;t and if the constraint was no external dependencies at all?</description> <content:encoded><![CDATA[<p>I was going to say the same thing as Ryan but he beat me to it. Thanks to your answer I understand why Castle is OK on that specific project, but what would you do if it wasn&#8217;t and if the constraint was no external dependencies at all?</p> ]]></content:encoded> </item> <item><title>By: Davy Brion</title><link>http://davybrion.com/blog/2009/08/build-your-own-data-access-layer-lazy-loading/comment-page-1/#comment-22355</link> <dc:creator>Davy Brion</dc:creator> <pubDate>Thu, 27 Aug 2009 18:36:05 +0000</pubDate> <guid
isPermaLink="false">http://davybrion.com/blog/?p=1528#comment-22355</guid> <description>I think their biggest fear is simply that of not being able to &#039;change&#039; things in case something doesn&#039;t work. We&#039;ve suggested NHibernate, Linq To SQL, Entity Framework, ... you name it.  They didn&#039;t want any of it... the only thing they have no problem with is either stored procedures, or straight ADO.NET.The fact that this DAL is somewhat reminiscent of NHibernate (in terms of usage, not in terms of features) is either something they won&#039;t even realize, or won&#039;t even care about because the code is right there and it&#039;s easy to modify in case things &#039;go wrong&#039;.I&#039;m not even gonna get into their realistic abilities when it comes to changing things for the better, but that is unfortunately their attitude. And it&#039;s only when it comes to data access.  We can use Windsor, we can use DynamicProxy, we can use the Request/Response service layer... they don&#039;t care about any of that.I&#039;ve been having discussions like that for about a year now, and after a while i simply stopped caring.  It&#039;s their problem and if they&#039;re willing to pay the extra cost that comes with such a mindset, then so be it.  But repetitive and error-prone data-access code is something i can&#039;t stand, whether you write it manually or even if it&#039;s generated... that&#039;s why i finally wrote this :)</description> <content:encoded><![CDATA[<p>I think their biggest fear is simply that of not being able to &#8216;change&#8217; things in case something doesn&#8217;t work. We&#8217;ve suggested NHibernate, Linq To SQL, Entity Framework, &#8230; you name it.  They didn&#8217;t want any of it&#8230; the only thing they have no problem with is either stored procedures, or straight ADO.NET.</p><p>The fact that this DAL is somewhat reminiscent of NHibernate (in terms of usage, not in terms of features) is either something they won&#8217;t even realize, or won&#8217;t even care about because the code is right there and it&#8217;s easy to modify in case things &#8216;go wrong&#8217;.</p><p>I&#8217;m not even gonna get into their realistic abilities when it comes to changing things for the better, but that is unfortunately their attitude. And it&#8217;s only when it comes to data access.  We can use Windsor, we can use DynamicProxy, we can use the Request/Response service layer&#8230; they don&#8217;t care about any of that.</p><p>I&#8217;ve been having discussions like that for about a year now, and after a while i simply stopped caring.  It&#8217;s their problem and if they&#8217;re willing to pay the extra cost that comes with such a mindset, then so be it.  But repetitive and error-prone data-access code is something i can&#8217;t stand, whether you write it manually or even if it&#8217;s generated&#8230; that&#8217;s why i finally wrote this <img
src='http://d18sni7re4ly7f.cloudfront.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p> ]]></content:encoded> </item> <item><title>By: Ryan Scott</title><link>http://davybrion.com/blog/2009/08/build-your-own-data-access-layer-lazy-loading/comment-page-1/#comment-22354</link> <dc:creator>Ryan Scott</dc:creator> <pubDate>Thu, 27 Aug 2009 18:10:59 +0000</pubDate> <guid
isPermaLink="false">http://davybrion.com/blog/?p=1528#comment-22354</guid> <description>Davy, I thought the reason you were building a custom DAL was to circumvent NIH attitudes.  Doesn&#039;t using DynamicProxy raise the same concerns? Or are they only concerned with owning/writing the DAL as a whole?</description> <content:encoded><![CDATA[<p>Davy, I thought the reason you were building a custom DAL was to circumvent NIH attitudes.  Doesn&#8217;t using DynamicProxy raise the same concerns? Or are they only concerned with owning/writing the DAL as a whole?</p> ]]></content:encoded> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced
Database Caching 2/20 queries in 0.012 seconds using disk: basic
Object Caching 592/593 objects using disk: basic
Content Delivery Network via Amazon Web Services: CloudFront: d18sni7re4ly7f.cloudfront.net

Served from: davybrion.com @ 2012-05-22 12:20:16 -->
