<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" version="2.0">
<channel>
	<title>Comments for The .Net frog</title>
	
	<link>http://www.thedotnetfrog.com</link>
	<description>Thoughts (ok, rants!) about programming and .NET from the land of frogs!</description>
	<lastBuildDate>Sun, 18 Jul 2010 12:45:27 +0200</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/thedotnetfrog-comments" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="thedotnetfrog-comments" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>Comment on Yet another blogger on earth! by Catering</title>
		<link>http://www.thedotnetfrog.com/2008/04/04/yet-another-blogger-on-earth/comment-page-1/#comment-87</link>
		<dc:creator>Catering</dc:creator>
		<pubDate>Sun, 18 Jul 2010 12:45:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.thedotnetfrog.com/?p=42#comment-87</guid>
		<description>Caterers  (????????)and their staff are part of the food service industry. When most people refer to a "caterer", they are referring to an event caterer who serves food with waiting staff at dining tables or sets up a self-serve buffet. 
The food may be prepared on site, i.e., made completely at the event, or the caterer may choose to bring prepared food and put the finishing touches on once it arrives. The event caterer staff are not responsible for preparing the food but often help set up the dining area. This service is typically provided at banquets, conventions, and weddings. Any event where all who attend are provided with food and drinks or sometimes only hors d'oeuvres is often called a catered event.</description>
		<content:encoded><![CDATA[<p>Caterers  (????????)and their staff are part of the food service industry. When most people refer to a &#8220;caterer&#8221;, they are referring to an event caterer who serves food with waiting staff at dining tables or sets up a self-serve buffet.<br />
The food may be prepared on site, i.e., made completely at the event, or the caterer may choose to bring prepared food and put the finishing touches on once it arrives. The event caterer staff are not responsible for preparing the food but often help set up the dining area. This service is typically provided at banquets, conventions, and weddings. Any event where all who attend are provided with food and drinks or sometimes only hors d&#8217;oeuvres is often called a catered event.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Yet another blogger on earth! by ????????</title>
		<link>http://www.thedotnetfrog.com/2008/04/04/yet-another-blogger-on-earth/comment-page-1/#comment-86</link>
		<dc:creator>????????</dc:creator>
		<pubDate>Sun, 18 Jul 2010 12:44:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.thedotnetfrog.com/?p=42#comment-86</guid>
		<description>????? ????? ?????????? ?????? ???? ??? ????? ????? ??????? ?? ??? ?"??????". ?????? ?????? "?'?????" - ??? ?? ??????? ?????? ???? ?"?'??????" - ??????? ????, "??????'?, "?'???'?????, "???'??" ??????? ??????? ?????, ??????? ????????? - ????? ?????? ?? ???. 
?? ?????? ??? ???????? ??????????, ???? ???? ?????? ?????? ??????, ?????? ??????? ??? ????????. ?????? ?????? ?????? ?? ???, ??? ????? ???? ????? ???, ??????? ?????? ?? ???? ????? ???? ?? "???????" ????? ?? ?????.</description>
		<content:encoded><![CDATA[<p>????? ????? ?????????? ?????? ???? ??? ????? ????? ??????? ?? ??? ?&#8221;??????&#8221;. ?????? ?????? &#8220;?&#8217;?????&#8221; &#8211; ??? ?? ??????? ?????? ???? ?&#8221;?&#8217;??????&#8221; &#8211; ??????? ????, &#8220;??????&#8217;?, &#8220;?&#8217;???&#8217;?????, &#8220;???&#8217;??&#8221; ??????? ??????? ?????, ??????? ????????? &#8211; ????? ?????? ?? ???.<br />
?? ?????? ??? ???????? ??????????, ???? ???? ?????? ?????? ??????, ?????? ??????? ??? ????????. ?????? ?????? ?????? ?? ???, ??? ????? ???? ????? ???, ??????? ?????? ?? ???? ????? ???? ?? &#8220;???????&#8221; ????? ?? ?????.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Yet another blogger on earth! by dani gilad</title>
		<link>http://www.thedotnetfrog.com/2008/04/04/yet-another-blogger-on-earth/comment-page-1/#comment-85</link>
		<dc:creator>dani gilad</dc:creator>
		<pubDate>Sun, 18 Jul 2010 09:56:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.thedotnetfrog.com/?p=42#comment-85</guid>
		<description>RSS (most commonly expanded as Really Simple Syndication) is a family of web feed formats used to publish frequently updated works—such as blog  entries, news headlines, audio, and video—in a standardized format. An RSS document (which is called a "feed", "web feed", or "channel") includes full or summarized text, plus metadata  such as publishing dates and authorship. Web feeds benefit publishers by letting them syndicate content automatically. They benefit readers who want to subscribe to timely updates from favored websites or to aggregate feeds from many sites into one place. RSS feeds can be read using software called an "RSS reader", "feed reader", or "aggregator", which can be web-based, desktop-based, or mobile-device-based.
Event ranges from box-lunch drop-off to full-service catering. Caterers  (????????)and their staff are part of the food service industry. When most people refer to a "caterer", they are referring to an event caterer who serves food with waiting staff at dining tables or sets up a self-serve buffet.</description>
		<content:encoded><![CDATA[<p>RSS (most commonly expanded as Really Simple Syndication) is a family of web feed formats used to publish frequently updated works—such as blog  entries, news headlines, audio, and video—in a standardized format. An RSS document (which is called a &#8220;feed&#8221;, &#8220;web feed&#8221;, or &#8220;channel&#8221;) includes full or summarized text, plus metadata  such as publishing dates and authorship. Web feeds benefit publishers by letting them syndicate content automatically. They benefit readers who want to subscribe to timely updates from favored websites or to aggregate feeds from many sites into one place. RSS feeds can be read using software called an &#8220;RSS reader&#8221;, &#8220;feed reader&#8221;, or &#8220;aggregator&#8221;, which can be web-based, desktop-based, or mobile-device-based.<br />
Event ranges from box-lunch drop-off to full-service catering. Caterers  (????????)and their staff are part of the food service industry. When most people refer to a &#8220;caterer&#8221;, they are referring to an event caterer who serves food with waiting staff at dining tables or sets up a self-serve buffet.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Performance impact of the readonly keyword by Andrei Rinea</title>
		<link>http://www.thedotnetfrog.com/2008/04/22/performance-impact-of-the-readonly-keyword/comment-page-1/#comment-84</link>
		<dc:creator>Andrei Rinea</dc:creator>
		<pubDate>Wed, 17 Mar 2010 08:38:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.thedotnetfrog.com/?p=46#comment-84</guid>
		<description>Maybe your co-worker was confusing readonly with const.

That would make a lot of sense..</description>
		<content:encoded><![CDATA[<p>Maybe your co-worker was confusing readonly with const.</p>
<p>That would make a lot of sense..</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on AutoResetEvent vs ManualResetEvent: beware! by ???????? ????</title>
		<link>http://www.thedotnetfrog.com/2008/04/07/autoresetevent-vs-manualresetevent-beware/comment-page-1/#comment-83</link>
		<dc:creator>???????? ????</dc:creator>
		<pubDate>Wed, 06 Jan 2010 15:07:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.lavigneducadet.com/wordpress/?p=37#comment-83</guid>
		<description>Just imagine that the AutoResetEvent executes WaitOne() and Reset() as a single atomic operation.
thanks for the great article!</description>
		<content:encoded><![CDATA[<p>Just imagine that the AutoResetEvent executes WaitOne() and Reset() as a single atomic operation.<br />
thanks for the great article!</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Choosing composition over inheritance: yet another example! by ??????</title>
		<link>http://www.thedotnetfrog.com/2008/05/30/choosing-composition-over-inheritance-yet-another-example/comment-page-1/#comment-81</link>
		<dc:creator>??????</dc:creator>
		<pubDate>Wed, 21 Oct 2009 13:25:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.thedotnetfrog.com/?p=55#comment-81</guid>
		<description>???? ??? ?????</description>
		<content:encoded><![CDATA[<p>???? ??? ?????</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on AutoResetEvent vs ManualResetEvent: beware! by Anonymous</title>
		<link>http://www.thedotnetfrog.com/2008/04/07/autoresetevent-vs-manualresetevent-beware/comment-page-1/#comment-79</link>
		<dc:creator>Anonymous</dc:creator>
		<pubDate>Fri, 18 Sep 2009 13:33:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.lavigneducadet.com/wordpress/?p=37#comment-79</guid>
		<description>If AutoresetEvent's Set is Called when it is not required, then there is no use of Waitone in the thread.. Beaware of it folks !!!</description>
		<content:encoded><![CDATA[<p>If AutoresetEvent&#8217;s Set is Called when it is not required, then there is no use of Waitone in the thread.. Beaware of it folks !!!</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on AutoResetEvent vs ManualResetEvent: beware! by Anonymous</title>
		<link>http://www.thedotnetfrog.com/2008/04/07/autoresetevent-vs-manualresetevent-beware/comment-page-1/#comment-78</link>
		<dc:creator>Anonymous</dc:creator>
		<pubDate>Fri, 18 Sep 2009 13:31:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.lavigneducadet.com/wordpress/?p=37#comment-78</guid>
		<description>Yes u r right.. but there is one more problem here in AutoresetEvent's
Set Method.. It has to be called when it is needed. if not again u will get into trouble.</description>
		<content:encoded><![CDATA[<p>Yes u r right.. but there is one more problem here in AutoresetEvent&#8217;s<br />
Set Method.. It has to be called when it is needed. if not again u will get into trouble.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Choosing composition over inheritance: yet another example! by Naveena</title>
		<link>http://www.thedotnetfrog.com/2008/05/30/choosing-composition-over-inheritance-yet-another-example/comment-page-1/#comment-71</link>
		<dc:creator>Naveena</dc:creator>
		<pubDate>Wed, 01 Apr 2009 22:04:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.thedotnetfrog.com/?p=55#comment-71</guid>
		<description>Simple example.. thanks</description>
		<content:encoded><![CDATA[<p>Simple example.. thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Choosing composition over inheritance: yet another example! by Anonymous</title>
		<link>http://www.thedotnetfrog.com/2008/05/30/choosing-composition-over-inheritance-yet-another-example/comment-page-1/#comment-70</link>
		<dc:creator>Anonymous</dc:creator>
		<pubDate>Wed, 01 Apr 2009 22:04:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.thedotnetfrog.com/?p=55#comment-70</guid>
		<description>Excellent</description>
		<content:encoded><![CDATA[<p>Excellent</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Choosing composition over inheritance: yet another example! by Julien</title>
		<link>http://www.thedotnetfrog.com/2008/05/30/choosing-composition-over-inheritance-yet-another-example/comment-page-1/#comment-57</link>
		<dc:creator>Julien</dc:creator>
		<pubDate>Fri, 13 Mar 2009 06:41:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.thedotnetfrog.com/?p=55#comment-57</guid>
		<description>It certainly was, my apologies !
I'll fix it right now !</description>
		<content:encoded><![CDATA[<p>It certainly was, my apologies !<br />
I&#8217;ll fix it right now !</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Choosing composition over inheritance: yet another example! by brad</title>
		<link>http://www.thedotnetfrog.com/2008/05/30/choosing-composition-over-inheritance-yet-another-example/comment-page-1/#comment-56</link>
		<dc:creator>brad</dc:creator>
		<pubDate>Thu, 12 Mar 2009 15:03:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.thedotnetfrog.com/?p=55#comment-56</guid>
		<description>That's what I thought, but the trip constructor that takes three arguments is assigned protected not public.  If I change your example to public, it works fine.  Was protected a mistype?</description>
		<content:encoded><![CDATA[<p>That&#8217;s what I thought, but the trip constructor that takes three arguments is assigned protected not public.  If I change your example to public, it works fine.  Was protected a mistype?</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Choosing composition over inheritance: yet another example! by Julien</title>
		<link>http://www.thedotnetfrog.com/2008/05/30/choosing-composition-over-inheritance-yet-another-example/comment-page-1/#comment-55</link>
		<dc:creator>Julien</dc:creator>
		<pubDate>Thu, 12 Mar 2009 08:20:40 +0000</pubDate>
		<guid isPermaLink="false">http://www.thedotnetfrog.com/?p=55#comment-55</guid>
		<description>You would not use directry an instance of ITransportationMode, you would inject it in the Trip class like this : 

Trip tripToParis = new Trip("barcelona", "paris", new PlaneTransportationMode());
DateTime arrivalTime = tripToParis.CalculateEstimatedArrivalTime()

The point is that this calculation can change and it should not be the responsability of the Trip class to perform it. Therefore, the best way to change the behavior of the trip class is not through inheritance but through composition.

Now, keep in mind that this example is very basic and in a real application you would have real logic in CalculateTransportationTimeBetween() :)</description>
		<content:encoded><![CDATA[<p>You would not use directry an instance of ITransportationMode, you would inject it in the Trip class like this : </p>
<p>Trip tripToParis = new Trip(&#8221;barcelona&#8221;, &#8220;paris&#8221;, new PlaneTransportationMode());<br />
DateTime arrivalTime = tripToParis.CalculateEstimatedArrivalTime()</p>
<p>The point is that this calculation can change and it should not be the responsability of the Trip class to perform it. Therefore, the best way to change the behavior of the trip class is not through inheritance but through composition.</p>
<p>Now, keep in mind that this example is very basic and in a real application you would have real logic in CalculateTransportationTimeBetween() :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Choosing composition over inheritance: yet another example! by brad</title>
		<link>http://www.thedotnetfrog.com/2008/05/30/choosing-composition-over-inheritance-yet-another-example/comment-page-1/#comment-54</link>
		<dc:creator>brad</dc:creator>
		<pubDate>Wed, 11 Mar 2009 13:25:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.thedotnetfrog.com/?p=55#comment-54</guid>
		<description>how do you run this code?

CarTransportationMode c = new CarTransportationMode();
TimeSpan s = c.CalculateTransportationTimeBetween("", "");

I don't see where the Trip class is used or the benefits of this?</description>
		<content:encoded><![CDATA[<p>how do you run this code?</p>
<p>CarTransportationMode c = new CarTransportationMode();<br />
TimeSpan s = c.CalculateTransportationTimeBetween(&#8221;", &#8220;&#8221;);</p>
<p>I don&#8217;t see where the Trip class is used or the benefits of this?</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Choosing composition over inheritance: yet another example! by Nick Wiggill</title>
		<link>http://www.thedotnetfrog.com/2008/05/30/choosing-composition-over-inheritance-yet-another-example/comment-page-1/#comment-53</link>
		<dc:creator>Nick Wiggill</dc:creator>
		<pubDate>Sat, 14 Feb 2009 14:31:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.thedotnetfrog.com/?p=55#comment-53</guid>
		<description>Here's another example:

http://www.visualharmonics.co.uk/actionscript-3/using-function-closures-in-object-composition/</description>
		<content:encoded><![CDATA[<p>Here&#8217;s another example:</p>
<p><a href="http://www.visualharmonics.co.uk/actionscript-3/using-function-closures-in-object-composition/" rel="nofollow" onclick="javascript:pageTracker._trackPageview('/outbound/comment/http://www.visualharmonics.co.uk/actionscript-3/using-function-closures-in-object-composition/');">http://www.visualharmonics.co.uk/actionscript-3/using-function-closures-in-object-composition/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Choosing composition over inheritance: yet another example! by Nick Wiggill</title>
		<link>http://www.thedotnetfrog.com/2008/05/30/choosing-composition-over-inheritance-yet-another-example/comment-page-1/#comment-52</link>
		<dc:creator>Nick Wiggill</dc:creator>
		<pubDate>Wed, 11 Feb 2009 20:24:14 +0000</pubDate>
		<guid isPermaLink="false">http://www.thedotnetfrog.com/?p=55#comment-52</guid>
		<description>Excellent, thanks for a simple example Julien.</description>
		<content:encoded><![CDATA[<p>Excellent, thanks for a simple example Julien.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Choosing composition over inheritance: yet another example! by Thomas Jensen</title>
		<link>http://www.thedotnetfrog.com/2008/05/30/choosing-composition-over-inheritance-yet-another-example/comment-page-1/#comment-51</link>
		<dc:creator>Thomas Jensen</dc:creator>
		<pubDate>Fri, 06 Feb 2009 22:30:51 +0000</pubDate>
		<guid isPermaLink="false">http://www.thedotnetfrog.com/?p=55#comment-51</guid>
		<description>Thanks...:)</description>
		<content:encoded><![CDATA[<p>Thanks&#8230;:)</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on AutoResetEvent vs ManualResetEvent: beware! by Guimasun</title>
		<link>http://www.thedotnetfrog.com/2008/04/07/autoresetevent-vs-manualresetevent-beware/comment-page-1/#comment-46</link>
		<dc:creator>Guimasun</dc:creator>
		<pubDate>Mon, 30 Jun 2008 14:33:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.lavigneducadet.com/wordpress/?p=37#comment-46</guid>
		<description>The same happened to me. I was using a AutoResentEvent to sinalize thread termination, but sometimes the condition had been tested inside the thread loop which resets the event, so the while condition would never end.
Cheers</description>
		<content:encoded><![CDATA[<p>The same happened to me. I was using a AutoResentEvent to sinalize thread termination, but sometimes the condition had been tested inside the thread loop which resets the event, so the while condition would never end.<br />
Cheers</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on The null singleton by Julien</title>
		<link>http://www.thedotnetfrog.com/2008/05/24/the-null-singleton/comment-page-1/#comment-30</link>
		<dc:creator>Julien</dc:creator>
		<pubDate>Mon, 26 May 2008 12:50:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.thedotnetfrog.com/?p=44#comment-30</guid>
		<description>Multithreading is definitely an issue with singletons: most of the time, the implementation is not thread safe which can result in a "lost" instance as you were saying. Even if garbage collection is there, it can have several nasty effects depending on the context. For instance, the second instance created can try to access something that will be locked by the first instance and then fail to instantiate itself properly.

Concerning your way to initialize the singleton, I think it will be thread safe because a static field is only populated once by the CLR. However, the problem is that the instance will be created as soon something from the class is called for the first time. Therefore, you have even less control on when the instance will be created (but that might be perfectly acceptable :)). Using a static constructor might also be problematic. In that case, the instance will be created when the class is accessed but if an exception happens in the static constructor, it will be rethrown as a TypeInitializationException which would be a bit surprising I guess. More information &lt;a href="http://geekswithblogs.net/akraus1/articles/90803.aspx" rel="nofollow"&gt;here&lt;/a&gt;.

Finally, disposing a singleton is not something I've seen before and I would even say that it's probably a code-smell. As a matter of fact, I don't think you should dispose a singleton during the lifetime of the program. You might want to reset the state of the singleton somehow, but not dispose it. If you need to dispose it before the end of the program, you might end up with dozens or hundreds of initializations of your singleton... it will be totally uncontrolled. If you're at the end of the lifetime of the program, then it's not really a big deal because the CLR will release all the resources for you anyway.</description>
		<content:encoded><![CDATA[<p>Multithreading is definitely an issue with singletons: most of the time, the implementation is not thread safe which can result in a &#8220;lost&#8221; instance as you were saying. Even if garbage collection is there, it can have several nasty effects depending on the context. For instance, the second instance created can try to access something that will be locked by the first instance and then fail to instantiate itself properly.</p>
<p>Concerning your way to initialize the singleton, I think it will be thread safe because a static field is only populated once by the CLR. However, the problem is that the instance will be created as soon something from the class is called for the first time. Therefore, you have even less control on when the instance will be created (but that might be perfectly acceptable :)). Using a static constructor might also be problematic. In that case, the instance will be created when the class is accessed but if an exception happens in the static constructor, it will be rethrown as a TypeInitializationException which would be a bit surprising I guess. More information <a href="http://geekswithblogs.net/akraus1/articles/90803.aspx" rel="nofollow" onclick="javascript:pageTracker._trackPageview('/outbound/comment/http://geekswithblogs.net/akraus1/articles/90803.aspx');">here</a>.</p>
<p>Finally, disposing a singleton is not something I&#8217;ve seen before and I would even say that it&#8217;s probably a code-smell. As a matter of fact, I don&#8217;t think you should dispose a singleton during the lifetime of the program. You might want to reset the state of the singleton somehow, but not dispose it. If you need to dispose it before the end of the program, you might end up with dozens or hundreds of initializations of your singleton&#8230; it will be totally uncontrolled. If you&#8217;re at the end of the lifetime of the program, then it&#8217;s not really a big deal because the CLR will release all the resources for you anyway.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on The null singleton by agamemnon</title>
		<link>http://www.thedotnetfrog.com/2008/05/24/the-null-singleton/comment-page-1/#comment-29</link>
		<dc:creator>agamemnon</dc:creator>
		<pubDate>Mon, 26 May 2008 08:49:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.thedotnetfrog.com/?p=44#comment-29</guid>
		<description>Hello Julien,

I have few remarks about instance initialization in singleton. Concurrency access and instance creation are often forgotten when using this design pattern. This can lead to the creation of more than one instance (but thanks to the garbage collector if available, only one will be kept).
The second remark is rather a question. The class instance can be created in class loading time with a static block like this : private static Singleton instance = new Singleton();
This creation method can solve some extra cost when managing the concurrent access to the instance, but is it safe to use it? (I have some doubts about dll loading order and instances creation).
You mention the case where we have a large number of singleton. I have noticed in the software I'm working on it is that there is no method to free the instance.

Regards</description>
		<content:encoded><![CDATA[<p>Hello Julien,</p>
<p>I have few remarks about instance initialization in singleton. Concurrency access and instance creation are often forgotten when using this design pattern. This can lead to the creation of more than one instance (but thanks to the garbage collector if available, only one will be kept).<br />
The second remark is rather a question. The class instance can be created in class loading time with a static block like this : private static Singleton instance = new Singleton();<br />
This creation method can solve some extra cost when managing the concurrent access to the instance, but is it safe to use it? (I have some doubts about dll loading order and instances creation).<br />
You mention the case where we have a large number of singleton. I have noticed in the software I&#8217;m working on it is that there is no method to free the instance.</p>
<p>Regards</p>
]]></content:encoded>
	</item>
</channel>
</rss>
