<?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: IDisposable Part 3 &#8211; Encapsulating an IDisposable class</title>
	<atom:link href="http://reedcopsey.com/2009/04/19/idisposable-part-3-encapsulating-an-idisposable-class/feed/" rel="self" type="application/rss+xml" />
	<link>http://reedcopsey.com/2009/04/19/idisposable-part-3-encapsulating-an-idisposable-class/</link>
	<description>Thoughts on C#, WPF, .NET, and programming for Scientific Visualization</description>
	<lastBuildDate>Wed, 01 Feb 2012 16:38:09 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Reed</title>
		<link>http://reedcopsey.com/2009/04/19/idisposable-part-3-encapsulating-an-idisposable-class/#comment-491</link>
		<dc:creator>Reed</dc:creator>
		<pubDate>Fri, 08 Jan 2010 02:25:49 +0000</pubDate>
		<guid isPermaLink="false">http://reedcopsey.com/?p=27#comment-491</guid>
		<description>Zamesking: 

Thanks for the feedback!

I&#039;m glad the post is helping.   The series on IDisposable was probably my favorite, up until my new MVVM one ;)  Both are trying to tackle a subject that&#039;s been talked about a lot, but take it on from a slightly different angle, in a bit more depth.  I hope you find them useful.

-Reed</description>
		<content:encoded><![CDATA[<p>Zamesking: </p>
<p>Thanks for the feedback!</p>
<p>I&#8217;m glad the post is helping.   The series on IDisposable was probably my favorite, up until my new MVVM one <img src='http://reedcopsey.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />   Both are trying to tackle a subject that&#8217;s been talked about a lot, but take it on from a slightly different angle, in a bit more depth.  I hope you find them useful.</p>
<p>-Reed</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: zamesking</title>
		<link>http://reedcopsey.com/2009/04/19/idisposable-part-3-encapsulating-an-idisposable-class/#comment-490</link>
		<dc:creator>zamesking</dc:creator>
		<pubDate>Fri, 08 Jan 2010 01:41:12 +0000</pubDate>
		<guid isPermaLink="false">http://reedcopsey.com/?p=27#comment-490</guid>
		<description>Reed,

Thanks for explaining it clearly, I just forgot the purpose of the IDisposable interface. Actually, here AFactory class implements IDisposable interface to make it can be release it&#039;s managed resources explicitly.

Keep your good work, I decide to go through all your MVVM articles. Actually, I get to know you in msdn forums, and find you can always explaining tech in clear words, and your suggestions in the blogs are very helpful.</description>
		<content:encoded><![CDATA[<p>Reed,</p>
<p>Thanks for explaining it clearly, I just forgot the purpose of the IDisposable interface. Actually, here AFactory class implements IDisposable interface to make it can be release it&#8217;s managed resources explicitly.</p>
<p>Keep your good work, I decide to go through all your MVVM articles. Actually, I get to know you in msdn forums, and find you can always explaining tech in clear words, and your suggestions in the blogs are very helpful.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Reed</title>
		<link>http://reedcopsey.com/2009/04/19/idisposable-part-3-encapsulating-an-idisposable-class/#comment-460</link>
		<dc:creator>Reed</dc:creator>
		<pubDate>Wed, 06 Jan 2010 01:01:05 +0000</pubDate>
		<guid isPermaLink="false">http://reedcopsey.com/?p=27#comment-460</guid>
		<description>Zamesking:

It won&#039;t be a problem.  If AFactory is every a candidate for finalization, that means that all of its private managed resources (in this case, LicenseGenerator) will also be candidates for finalization.  When LicenseGenerator&#039;s finalizer runs, it will dispose of the unmanaged resource.  There is no need for an explicit finalizer in AFactory, only in LicenseGenerator.

This is why, when encapsulating an IDisposable, you don&#039;t need a finalizer - even though you still want to be IDisposable, and why the pattern is differnet in this case.  If you directly contain a native resource, you need a finalizer - otherwise, you typically do not need one.</description>
		<content:encoded><![CDATA[<p>Zamesking:</p>
<p>It won&#8217;t be a problem.  If AFactory is every a candidate for finalization, that means that all of its private managed resources (in this case, LicenseGenerator) will also be candidates for finalization.  When LicenseGenerator&#8217;s finalizer runs, it will dispose of the unmanaged resource.  There is no need for an explicit finalizer in AFactory, only in LicenseGenerator.</p>
<p>This is why, when encapsulating an IDisposable, you don&#8217;t need a finalizer &#8211; even though you still want to be IDisposable, and why the pattern is differnet in this case.  If you directly contain a native resource, you need a finalizer &#8211; otherwise, you typically do not need one.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: zamesking</title>
		<link>http://reedcopsey.com/2009/04/19/idisposable-part-3-encapsulating-an-idisposable-class/#comment-459</link>
		<dc:creator>zamesking</dc:creator>
		<pubDate>Wed, 06 Jan 2010 00:47:46 +0000</pubDate>
		<guid isPermaLink="false">http://reedcopsey.com/?p=27#comment-459</guid>
		<description>Hi reed,

In this case, if the user forgets to call the dispose method of AFactory, unmanaged resources of LicenseGenerator will not be released. While in pattern1 and partter2. the finalizer will call dispose(false) to dispose unmanned resource when they forget to. Will this be a problem?</description>
		<content:encoded><![CDATA[<p>Hi reed,</p>
<p>In this case, if the user forgets to call the dispose method of AFactory, unmanaged resources of LicenseGenerator will not be released. While in pattern1 and partter2. the finalizer will call dispose(false) to dispose unmanned resource when they forget to. Will this be a problem?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
 
