<?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: Must Everything Be Virtual With NHibernate?</title>
	<atom:link href="http://davybrion.com/blog/2009/03/must-everything-be-virtual-with-nhibernate/feed/" rel="self" type="application/rss+xml" />
	<link>http://davybrion.com/blog/2009/03/must-everything-be-virtual-with-nhibernate/</link>
	<description>Trying to walk that thin line between intelligence and ignorance</description>
	<lastBuildDate>Mon, 15 Mar 2010 08:03:58 +0100</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Setting up Table/Object mappings using Fluent nHibernate &#8211; Matt Long (.com.au)</title>
		<link>http://davybrion.com/blog/2009/03/must-everything-be-virtual-with-nhibernate/comment-page-1/#comment-27776</link>
		<dc:creator>Setting up Table/Object mappings using Fluent nHibernate &#8211; Matt Long (.com.au)</dc:creator>
		<pubDate>Mon, 08 Feb 2010 19:21:32 +0000</pubDate>
		<guid isPermaLink="false">http://davybrion.com/blog/?p=1210#comment-27776</guid>
		<description>[...] proxies to achieve its Lazy Loading feature.&#160; This is a bit beyond the scope of this post, but Davy Brion offers a pretty detailed explination, The quick answer to that question is: because we need members to be virtual in order to do our [...]</description>
		<content:encoded><![CDATA[<p>[...] proxies to achieve its Lazy Loading feature.&#160; This is a bit beyond the scope of this post, but Davy Brion offers a pretty detailed explination, The quick answer to that question is: because we need members to be virtual in order to do our [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Must Everything Be Virtual With NHibernate, Part II &#124; The Inquisitive Coder &#8211; Davy Brion&#8217;s Blog</title>
		<link>http://davybrion.com/blog/2009/03/must-everything-be-virtual-with-nhibernate/comment-page-1/#comment-22599</link>
		<dc:creator>Must Everything Be Virtual With NHibernate, Part II &#124; The Inquisitive Coder &#8211; Davy Brion&#8217;s Blog</dc:creator>
		<pubDate>Wed, 23 Sep 2009 04:56:39 +0000</pubDate>
		<guid isPermaLink="false">http://davybrion.com/blog/?p=1210#comment-22599</guid>
		<description>[...] already tried to explain this before, but here&#8217;s a simple example from a presentation i recently did on [...]</description>
		<content:encoded><![CDATA[<p>[...] already tried to explain this before, but here&#8217;s a simple example from a presentation i recently did on [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: A total n00b’s guide to migrating from a custom data layer to Nhibernate: getting started - Tales from the Evil Empire</title>
		<link>http://davybrion.com/blog/2009/03/must-everything-be-virtual-with-nhibernate/comment-page-1/#comment-22278</link>
		<dc:creator>A total n00b’s guide to migrating from a custom data layer to Nhibernate: getting started - Tales from the Evil Empire</dc:creator>
		<pubDate>Tue, 18 Aug 2009 00:03:11 +0000</pubDate>
		<guid isPermaLink="false">http://davybrion.com/blog/?p=1210#comment-22278</guid>
		<description>[...] but it’s not as bad as it looks. What this is doing is declaring what library to use to generate dynamic proxies for our data classes. It is a good thing that NHibernate is open to multiple providers here, and the good news is this [...]</description>
		<content:encoded><![CDATA[<p>[...] but it’s not as bad as it looks. What this is doing is declaring what library to use to generate dynamic proxies for our data classes. It is a good thing that NHibernate is open to multiple providers here, and the good news is this [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter Morris</title>
		<link>http://davybrion.com/blog/2009/03/must-everything-be-virtual-with-nhibernate/comment-page-1/#comment-11805</link>
		<dc:creator>Peter Morris</dc:creator>
		<pubDate>Thu, 09 Apr 2009 12:08:34 +0000</pubDate>
		<guid isPermaLink="false">http://davybrion.com/blog/?p=1210#comment-11805</guid>
		<description>I&#039;m quite persistent, aren&#039;t I? :-)

So it&#039;s a way of loading a referenced object without fetching any state?  In your example I would fetch the category and then set product.Category = categoryProxyThatIsntInitialized right?</description>
		<content:encoded><![CDATA[<p>I&#8217;m quite persistent, aren&#8217;t I? <img src='http://davybrion.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>So it&#8217;s a way of loading a referenced object without fetching any state?  In your example I would fetch the category and then set product.Category = categoryProxyThatIsntInitialized right?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Davy Brion</title>
		<link>http://davybrion.com/blog/2009/03/must-everything-be-virtual-with-nhibernate/comment-page-1/#comment-11775</link>
		<dc:creator>Davy Brion</dc:creator>
		<pubDate>Thu, 09 Apr 2009 06:05:38 +0000</pubDate>
		<guid isPermaLink="false">http://davybrion.com/blog/?p=1210#comment-11775</guid>
		<description>That&#039;s the main difference between Session.Load and Session.Get (bad naming, i know). A lot of people use Session.Load for various reasons.  You can find one example here:
http://davybrion.com/blog/2009/04/assigning-foreign-keys-in-nhibernate/</description>
		<content:encoded><![CDATA[<p>That&#8217;s the main difference between Session.Load and Session.Get (bad naming, i know). A lot of people use Session.Load for various reasons.  You can find one example here:<br />
<a href="http://davybrion.com/blog/2009/04/assigning-foreign-keys-in-nhibernate/" rel="nofollow">http://davybrion.com/blog/2009/04/assigning-foreign-keys-in-nhibernate/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter Morris</title>
		<link>http://davybrion.com/blog/2009/03/must-everything-be-virtual-with-nhibernate/comment-page-1/#comment-11720</link>
		<dc:creator>Peter Morris</dc:creator>
		<pubDate>Wed, 08 Apr 2009 20:11:43 +0000</pubDate>
		<guid isPermaLink="false">http://davybrion.com/blog/?p=1210#comment-11720</guid>
		<description>Why would Session.Load fetch a proxy and not the true type?</description>
		<content:encoded><![CDATA[<p>Why would Session.Load fetch a proxy and not the true type?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Davy Brion</title>
		<link>http://davybrion.com/blog/2009/03/must-everything-be-virtual-with-nhibernate/comment-page-1/#comment-11643</link>
		<dc:creator>Davy Brion</dc:creator>
		<pubDate>Wed, 08 Apr 2009 06:03:52 +0000</pubDate>
		<guid isPermaLink="false">http://davybrion.com/blog/?p=1210#comment-11643</guid>
		<description>btw, you can just as easily get a proxy without going through an association by calling session.Load instead of session.Get.</description>
		<content:encoded><![CDATA[<p>btw, you can just as easily get a proxy without going through an association by calling session.Load instead of session.Get.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Davy Brion</title>
		<link>http://davybrion.com/blog/2009/03/must-everything-be-virtual-with-nhibernate/comment-page-1/#comment-11642</link>
		<dc:creator>Davy Brion</dc:creator>
		<pubDate>Wed, 08 Apr 2009 06:01:39 +0000</pubDate>
		<guid isPermaLink="false">http://davybrion.com/blog/?p=1210#comment-11642</guid>
		<description>if only the association properties were virtual, then merely accessing the proxy property would trigger the lazy load, which is not good either

Say you have order.Customer and the Customer property holds a reference to a proxy.  If only association properties should be virtual as you claim then merely accessing the Customer property would trigger the lazy load.  But what if i only want the Customer property&#039;s Id value? That one is already there in the proxy and can be retrieved without having to hit the database.  But when i access one of the proxy&#039;s other properties, say order.Customer.Name it needs to hit the database.</description>
		<content:encoded><![CDATA[<p>if only the association properties were virtual, then merely accessing the proxy property would trigger the lazy load, which is not good either</p>
<p>Say you have order.Customer and the Customer property holds a reference to a proxy.  If only association properties should be virtual as you claim then merely accessing the Customer property would trigger the lazy load.  But what if i only want the Customer property&#8217;s Id value? That one is already there in the proxy and can be retrieved without having to hit the database.  But when i access one of the proxy&#8217;s other properties, say order.Customer.Name it needs to hit the database.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter Morris</title>
		<link>http://davybrion.com/blog/2009/03/must-everything-be-virtual-with-nhibernate/comment-page-1/#comment-11603</link>
		<dc:creator>Peter Morris</dc:creator>
		<pubDate>Tue, 07 Apr 2009 20:19:55 +0000</pubDate>
		<guid isPermaLink="false">http://davybrion.com/blog/?p=1210#comment-11603</guid>
		<description>Thanks for your time today.  The scenario we came to certainly explained what the limitation actually is, and I am fairly convinced it is irrelevant.

I do however still disagree that everything needs to be virtual :-)  I think that only the association properties need to be virtual.  I can&#039;t think of a scenario where you will be able to get a proxy without going via an association.  For example when you load an object you get the object itself, all of its single links are instances of proxies but you can&#039;t get to that proxy unless you do LoadedObject.SomeAssociation so all you&#039;d really need is LoadedObject to be a proxy which loads the associated object when that property is accessed.

In the case of a multi-association again it&#039;s the property which must be accessed in order to obtain a reference to any item in its list.  How is it possible to access the proxy any other way?  I don&#039;t think it is.

So I am still utterly convinced that you only need to actually make association properties virtual.  If someone reading this could give me a step by step scenario of when not having virtual properties/methods on a class could cause problems (except for not making associations virtual) I would appreciate it :-)


Pete</description>
		<content:encoded><![CDATA[<p>Thanks for your time today.  The scenario we came to certainly explained what the limitation actually is, and I am fairly convinced it is irrelevant.</p>
<p>I do however still disagree that everything needs to be virtual <img src='http://davybrion.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />   I think that only the association properties need to be virtual.  I can&#8217;t think of a scenario where you will be able to get a proxy without going via an association.  For example when you load an object you get the object itself, all of its single links are instances of proxies but you can&#8217;t get to that proxy unless you do LoadedObject.SomeAssociation so all you&#8217;d really need is LoadedObject to be a proxy which loads the associated object when that property is accessed.</p>
<p>In the case of a multi-association again it&#8217;s the property which must be accessed in order to obtain a reference to any item in its list.  How is it possible to access the proxy any other way?  I don&#8217;t think it is.</p>
<p>So I am still utterly convinced that you only need to actually make association properties virtual.  If someone reading this could give me a step by step scenario of when not having virtual properties/methods on a class could cause problems (except for not making associations virtual) I would appreciate it <img src='http://davybrion.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>Pete</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter Morris</title>
		<link>http://davybrion.com/blog/2009/03/must-everything-be-virtual-with-nhibernate/comment-page-1/#comment-11537</link>
		<dc:creator>Peter Morris</dc:creator>
		<pubDate>Tue, 07 Apr 2009 06:37:18 +0000</pubDate>
		<guid isPermaLink="false">http://davybrion.com/blog/?p=1210#comment-11537</guid>
		<description>Thanks for adding me.  I hope you log into MSN now and again :-)</description>
		<content:encoded><![CDATA[<p>Thanks for adding me.  I hope you log into MSN now and again <img src='http://davybrion.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Davy Brion</title>
		<link>http://davybrion.com/blog/2009/03/must-everything-be-virtual-with-nhibernate/comment-page-1/#comment-11387</link>
		<dc:creator>Davy Brion</dc:creator>
		<pubDate>Sun, 05 Apr 2009 15:31:57 +0000</pubDate>
		<guid isPermaLink="false">http://davybrion.com/blog/?p=1210#comment-11387</guid>
		<description>sure, we&#039;ll talk about this on msn</description>
		<content:encoded><![CDATA[<p>sure, we&#8217;ll talk about this on msn</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter Morris</title>
		<link>http://davybrion.com/blog/2009/03/must-everything-be-virtual-with-nhibernate/comment-page-1/#comment-11322</link>
		<dc:creator>Peter Morris</dc:creator>
		<pubDate>Sat, 04 Apr 2009 22:12:49 +0000</pubDate>
		<guid isPermaLink="false">http://davybrion.com/blog/?p=1210#comment-11322</guid>
		<description>No, that&#039;s fine.  It&#039;s just that something seems so obvious to me that it cannot possibly be right and I wanted to be 100% sure I didn&#039;t have a basic fact wrong.

Now that I know I am not making a stupid mistake I would like to discuss it with you.  Do you think you might have 5 mins spare to chat on skype (mrpmorris) or msn (mrpmorris@live.co.uk)?  I&#039;m not after support or anything because I am not currently using NH :-)  I just wanted to discuss some ideas etc.


Cheers

Pete</description>
		<content:encoded><![CDATA[<p>No, that&#8217;s fine.  It&#8217;s just that something seems so obvious to me that it cannot possibly be right and I wanted to be 100% sure I didn&#8217;t have a basic fact wrong.</p>
<p>Now that I know I am not making a stupid mistake I would like to discuss it with you.  Do you think you might have 5 mins spare to chat on skype (mrpmorris) or msn (mrpmorris@live.co.uk)?  I&#8217;m not after support or anything because I am not currently using NH <img src='http://davybrion.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />   I just wanted to discuss some ideas etc.</p>
<p>Cheers</p>
<p>Pete</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Davy Brion</title>
		<link>http://davybrion.com/blog/2009/03/must-everything-be-virtual-with-nhibernate/comment-page-1/#comment-11177</link>
		<dc:creator>Davy Brion</dc:creator>
		<pubDate>Fri, 03 Apr 2009 21:02:07 +0000</pubDate>
		<guid isPermaLink="false">http://davybrion.com/blog/?p=1210#comment-11177</guid>
		<description>since i don&#039;t like repeating myself i&#039;m just gonna link to a comment i left earlier as a reply to the last time you asked that question ;)
http://davybrion.com/blog/2009/03/entities-required-properties-and-properties-that-shouldnt-be-modified/#comment-10632

but for a many-to-one association, the proxy will indeed be derived from the base type for reasons i&#039;ve already explained earlier</description>
		<content:encoded><![CDATA[<p>since i don&#8217;t like repeating myself i&#8217;m just gonna link to a comment i left earlier as a reply to the last time you asked that question <img src='http://davybrion.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /><br />
<a href="http://davybrion.com/blog/2009/03/entities-required-properties-and-properties-that-shouldnt-be-modified/#comment-10632" rel="nofollow">http://davybrion.com/blog/2009/03/entities-required-properties-and-properties-that-shouldnt-be-modified/#comment-10632</a></p>
<p>but for a many-to-one association, the proxy will indeed be derived from the base type for reasons i&#8217;ve already explained earlier</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter Morris</title>
		<link>http://davybrion.com/blog/2009/03/must-everything-be-virtual-with-nhibernate/comment-page-1/#comment-11137</link>
		<dc:creator>Peter Morris</dc:creator>
		<pubDate>Fri, 03 Apr 2009 13:31:11 +0000</pubDate>
		<guid isPermaLink="false">http://davybrion.com/blog/?p=1210#comment-11137</guid>
		<description>Hi Davy

Maybe I am misunderstanding the problem.  Let&#039;s take this model

  JobBatch 1---* JobAction

Where JobAction is abstract and has an abstract Execute method.  Now let&#039;s say that my lazy-load JobBatch object is used like this

  foreach(JobAction action in job.Actions)
    action.Execute();

Every instance in job.Actions is a dynamically created sub-class of JobAction isn&#039;t it?  Can you confirm this is the case?  We can work from there :-)</description>
		<content:encoded><![CDATA[<p>Hi Davy</p>
<p>Maybe I am misunderstanding the problem.  Let&#8217;s take this model</p>
<p>  JobBatch 1&#8212;* JobAction</p>
<p>Where JobAction is abstract and has an abstract Execute method.  Now let&#8217;s say that my lazy-load JobBatch object is used like this</p>
<p>  foreach(JobAction action in job.Actions)<br />
    action.Execute();</p>
<p>Every instance in job.Actions is a dynamically created sub-class of JobAction isn&#8217;t it?  Can you confirm this is the case?  We can work from there <img src='http://davybrion.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Davy Brion</title>
		<link>http://davybrion.com/blog/2009/03/must-everything-be-virtual-with-nhibernate/comment-page-1/#comment-10986</link>
		<dc:creator>Davy Brion</dc:creator>
		<pubDate>Wed, 01 Apr 2009 20:31:44 +0000</pubDate>
		<guid isPermaLink="false">http://davybrion.com/blog/?p=1210#comment-10986</guid>
		<description>@Peter

http://mijalko.blogspot.com/2009/03/hibernate-nhibernate-and-polymorphism.html

that has a workaround to the issue you mention, though i haven&#039;t tried it yet

having said that (and i can&#039;t believe this didn&#039;t cross my mind sooner), if you feel the need to check for the actual type when all you have is a base type (whether it&#039;s a proxy or not), you&#039;re kinda missing out on the whole point of polymorphism, no?</description>
		<content:encoded><![CDATA[<p>@Peter</p>
<p><a href="http://mijalko.blogspot.com/2009/03/hibernate-nhibernate-and-polymorphism.html" rel="nofollow">http://mijalko.blogspot.com/2009/03/hibernate-nhibernate-and-polymorphism.html</a></p>
<p>that has a workaround to the issue you mention, though i haven&#8217;t tried it yet</p>
<p>having said that (and i can&#8217;t believe this didn&#8217;t cross my mind sooner), if you feel the need to check for the actual type when all you have is a base type (whether it&#8217;s a proxy or not), you&#8217;re kinda missing out on the whole point of polymorphism, no?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Davy Brion</title>
		<link>http://davybrion.com/blog/2009/03/must-everything-be-virtual-with-nhibernate/comment-page-1/#comment-10943</link>
		<dc:creator>Davy Brion</dc:creator>
		<pubDate>Wed, 01 Apr 2009 09:04:47 +0000</pubDate>
		<guid isPermaLink="false">http://davybrion.com/blog/?p=1210#comment-10943</guid>
		<description>@Peter

the situation you are complaining about is a situation where we need to create a proxy _before_ hitting the database. If you can come up with a way that enables us to figure out which of the derived proxy type we should use without hitting the database, and without breaking anything, i would be more than happy to implement it for you.  Though i can&#039;t help but wonder why more people don&#039;t complain about this if it really is that big of an issue.</description>
		<content:encoded><![CDATA[<p>@Peter</p>
<p>the situation you are complaining about is a situation where we need to create a proxy _before_ hitting the database. If you can come up with a way that enables us to figure out which of the derived proxy type we should use without hitting the database, and without breaking anything, i would be more than happy to implement it for you.  Though i can&#8217;t help but wonder why more people don&#8217;t complain about this if it really is that big of an issue.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter Morris</title>
		<link>http://davybrion.com/blog/2009/03/must-everything-be-virtual-with-nhibernate/comment-page-1/#comment-10941</link>
		<dc:creator>Peter Morris</dc:creator>
		<pubDate>Wed, 01 Apr 2009 08:55:42 +0000</pubDate>
		<guid isPermaLink="false">http://davybrion.com/blog/?p=1210#comment-10941</guid>
		<description>@Davy

&quot;we can’t possibly determine the actual type _without hitting the database_&quot;

But when you access the lazy-load object you *do* go to the database to read its content, so you do know the exact types.</description>
		<content:encoded><![CDATA[<p>@Davy</p>
<p>&#8220;we can’t possibly determine the actual type _without hitting the database_&#8221;</p>
<p>But when you access the lazy-load object you *do* go to the database to read its content, so you do know the exact types.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Davy Brion</title>
		<link>http://davybrion.com/blog/2009/03/must-everything-be-virtual-with-nhibernate/comment-page-1/#comment-10940</link>
		<dc:creator>Davy Brion</dc:creator>
		<pubDate>Wed, 01 Apr 2009 08:50:53 +0000</pubDate>
		<guid isPermaLink="false">http://davybrion.com/blog/?p=1210#comment-10940</guid>
		<description>@Peter

right, lazy loading individual properties is not possible by default, though i do remember seeing a workaround for it once to enable it... that was far from trivial though

in case of the byte[] array, i&#039;d either put the byte[] array in a separate table which links to the original record and map it as an association, or use a separate mapped class which uses the same table.</description>
		<content:encoded><![CDATA[<p>@Peter</p>
<p>right, lazy loading individual properties is not possible by default, though i do remember seeing a workaround for it once to enable it&#8230; that was far from trivial though</p>
<p>in case of the byte[] array, i&#8217;d either put the byte[] array in a separate table which links to the original record and map it as an association, or use a separate mapped class which uses the same table.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter Morris</title>
		<link>http://davybrion.com/blog/2009/03/must-everything-be-virtual-with-nhibernate/comment-page-1/#comment-10939</link>
		<dc:creator>Peter Morris</dc:creator>
		<pubDate>Wed, 01 Apr 2009 08:47:05 +0000</pubDate>
		<guid isPermaLink="false">http://davybrion.com/blog/?p=1210#comment-10939</guid>
		<description>@Davy

So the virtual is for lazy loading ALL object state then, not for identifying which parts of the state should be lazy loaded?  What if your class has a large byte[] property which is only used 50% of the time?  I already use an ORM which lets me mark individual elements as lazy-load, and it loads polymorphic associations properly too (http://www.capableobjects.com)

Considering its popularity I am really very surprised that NH works this way.</description>
		<content:encoded><![CDATA[<p>@Davy</p>
<p>So the virtual is for lazy loading ALL object state then, not for identifying which parts of the state should be lazy loaded?  What if your class has a large byte[] property which is only used 50% of the time?  I already use an ORM which lets me mark individual elements as lazy-load, and it loads polymorphic associations properly too (<a href="http://www.capableobjects.com" rel="nofollow">http://www.capableobjects.com</a>)</p>
<p>Considering its popularity I am really very surprised that NH works this way.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Davy Brion</title>
		<link>http://davybrion.com/blog/2009/03/must-everything-be-virtual-with-nhibernate/comment-page-1/#comment-10888</link>
		<dc:creator>Davy Brion</dc:creator>
		<pubDate>Tue, 31 Mar 2009 13:04:06 +0000</pubDate>
		<guid isPermaLink="false">http://davybrion.com/blog/?p=1210#comment-10888</guid>
		<description>well no, NH doesn&#039;t really change the behavior of a domain object, outside of lazily loading its data if necessary

the only thing i&#039;m saying is that ignoring potential access to private backing fields (and there certainly are valid reasons why people want to do that) could lead to a host of problems, which could potentially be increased when using NH because you will sometimes end up with proxies and sometimes with real instances. Simply saying &quot;don&#039;t do that then&quot; doesn&#039;t really cut it IMO.

I do think that persistence ignorance is possible, but only with a very specific custom made ORM. NHibernate doesn&#039;t get you true persistence ignorance (otherwise we wouldn&#039;t require virtual public members or default constructors), but i do think it gets you far closer to it than any of the alternatives (outside of rolling your own)</description>
		<content:encoded><![CDATA[<p>well no, NH doesn&#8217;t really change the behavior of a domain object, outside of lazily loading its data if necessary</p>
<p>the only thing i&#8217;m saying is that ignoring potential access to private backing fields (and there certainly are valid reasons why people want to do that) could lead to a host of problems, which could potentially be increased when using NH because you will sometimes end up with proxies and sometimes with real instances. Simply saying &#8220;don&#8217;t do that then&#8221; doesn&#8217;t really cut it IMO.</p>
<p>I do think that persistence ignorance is possible, but only with a very specific custom made ORM. NHibernate doesn&#8217;t get you true persistence ignorance (otherwise we wouldn&#8217;t require virtual public members or default constructors), but i do think it gets you far closer to it than any of the alternatives (outside of rolling your own)</p>
]]></content:encoded>
	</item>
</channel>
</rss>
