<?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: Singletons are Pathological Liars</title>
	<atom:link href="http://misko.hevery.com/2008/08/17/singletons-are-pathological-liars/feed/" rel="self" type="application/rss+xml" />
	<link>http://misko.hevery.com/2008/08/17/singletons-are-pathological-liars/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=singletons-are-pathological-liars</link>
	<description>Testability Explorer</description>
	<lastBuildDate>Thu, 19 Jan 2012 16:42:57 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Are singletons pathalogical liars? &#124; Davelog</title>
		<link>http://misko.hevery.com/2008/08/17/singletons-are-pathological-liars/comment-page-2/#comment-15749</link>
		<dc:creator>Are singletons pathalogical liars? &#124; Davelog</dc:creator>
		<pubDate>Sat, 31 Dec 2011 23:48:33 +0000</pubDate>
		<guid isPermaLink="false">http://misko.hevery.com/?p=162#comment-15749</guid>
		<description>[...] Miško Hevery thinks so: Singletons are Pathological Liars. [...]</description>
		<content:encoded><![CDATA[<p>[...] Miško Hevery thinks so: Singletons are Pathological Liars. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bill H.</title>
		<link>http://misko.hevery.com/2008/08/17/singletons-are-pathological-liars/comment-page-2/#comment-14731</link>
		<dc:creator>Bill H.</dc:creator>
		<pubDate>Mon, 19 Dec 2011 19:56:25 +0000</pubDate>
		<guid isPermaLink="false">http://misko.hevery.com/?p=162#comment-14731</guid>
		<description>By the way, if the point about being global is that a Singleton can be included in any file and used anywhere in a program, that&#039;s true, but only bad if misused.  The Singleton pattern is not inherently bad, it&#039;s misuse is bad.

I should point out that the same issue exists with class instances.  They can be inappropriately passed to constructors violating certain design guidelines.  Bad object oriented design is always possible!  (There are more wrong things to do than right ones!).

However, the point about being global is off the mark, because in that case, it&#039;s the point!  If you only want one instance of a class, then clearly any client that needs an instance of that class has to use that one existing Singleton instance.  Whether that one instance is used inappropriately is a different matter.</description>
		<content:encoded><![CDATA[<p>By the way, if the point about being global is that a Singleton can be included in any file and used anywhere in a program, that&#8217;s true, but only bad if misused.  The Singleton pattern is not inherently bad, it&#8217;s misuse is bad.</p>
<p>I should point out that the same issue exists with class instances.  They can be inappropriately passed to constructors violating certain design guidelines.  Bad object oriented design is always possible!  (There are more wrong things to do than right ones!).</p>
<p>However, the point about being global is off the mark, because in that case, it&#8217;s the point!  If you only want one instance of a class, then clearly any client that needs an instance of that class has to use that one existing Singleton instance.  Whether that one instance is used inappropriately is a different matter.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bill H.</title>
		<link>http://misko.hevery.com/2008/08/17/singletons-are-pathological-liars/comment-page-2/#comment-14730</link>
		<dc:creator>Bill H.</dc:creator>
		<pubDate>Mon, 19 Dec 2011 19:50:59 +0000</pubDate>
		<guid isPermaLink="false">http://misko.hevery.com/?p=162#comment-14730</guid>
		<description>The purpose of the Singleton pattern is to allow only once instance of a class.  &#039;Merely&#039; declaring a global instance of a class doesn&#039;t do that. Another global instance could still be created.

While global variables are generally bad because of the scoping issue, if an attribute could be added to a global variable to prevent other instances of the variable&#039;s type, it would be like a Singleton, but it would only be bad if the global type wasn&#039;t scoped, such as class methods (and classes in namespaces).  (Of course, Class names are global too unless they&#039;re in a namespace, and there is nothing to prevent putting any class, including a Singleton class, in a namespace).

In this case, by design, a single instance of a class is desired, and a Singleton is the only way to do this. (That&#039;s by definition - any pattern that does this is a type of Singleton pattern).

Now, a good question is which Singleton pattern is best.  Scott Meyer&#039;s, and others, have addresses this issue.</description>
		<content:encoded><![CDATA[<p>The purpose of the Singleton pattern is to allow only once instance of a class.  &#8216;Merely&#8217; declaring a global instance of a class doesn&#8217;t do that. Another global instance could still be created.</p>
<p>While global variables are generally bad because of the scoping issue, if an attribute could be added to a global variable to prevent other instances of the variable&#8217;s type, it would be like a Singleton, but it would only be bad if the global type wasn&#8217;t scoped, such as class methods (and classes in namespaces).  (Of course, Class names are global too unless they&#8217;re in a namespace, and there is nothing to prevent putting any class, including a Singleton class, in a namespace).</p>
<p>In this case, by design, a single instance of a class is desired, and a Singleton is the only way to do this. (That&#8217;s by definition &#8211; any pattern that does this is a type of Singleton pattern).</p>
<p>Now, a good question is which Singleton pattern is best.  Scott Meyer&#8217;s, and others, have addresses this issue.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: misko</title>
		<link>http://misko.hevery.com/2008/08/17/singletons-are-pathological-liars/comment-page-2/#comment-11321</link>
		<dc:creator>misko</dc:creator>
		<pubDate>Wed, 19 Oct 2011 17:19:04 +0000</pubDate>
		<guid isPermaLink="false">http://misko.hevery.com/?p=162#comment-11321</guid>
		<description>@goob,

never let truth get in the way of a good story.</description>
		<content:encoded><![CDATA[<p>@goob,</p>
<p>never let truth get in the way of a good story.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: goob</title>
		<link>http://misko.hevery.com/2008/08/17/singletons-are-pathological-liars/comment-page-2/#comment-11312</link>
		<dc:creator>goob</dc:creator>
		<pubDate>Wed, 19 Oct 2011 13:19:50 +0000</pubDate>
		<guid isPermaLink="false">http://misko.hevery.com/?p=162#comment-11312</guid>
		<description>Did you really use your real-life credit card details to test software?! I&#039;ve only read a few paragraphs into this post (and will continue after I finish ranting) but that seems like a silly thing to do and $100 well spent on a life-lesson that you won&#039;t forget any time soon! :D</description>
		<content:encoded><![CDATA[<p>Did you really use your real-life credit card details to test software?! I&#8217;ve only read a few paragraphs into this post (and will continue after I finish ranting) but that seems like a silly thing to do and $100 well spent on a life-lesson that you won&#8217;t forget any time soon! <img src='http://misko.hevery.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: misko</title>
		<link>http://misko.hevery.com/2008/08/17/singletons-are-pathological-liars/comment-page-2/#comment-9238</link>
		<dc:creator>misko</dc:creator>
		<pubDate>Wed, 06 Jul 2011 21:41:12 +0000</pubDate>
		<guid isPermaLink="false">http://misko.hevery.com/?p=162#comment-9238</guid>
		<description>@Michel,

IOC, solves this problem by removing global state. So I don&#039;t think we are talking about the same thing.</description>
		<content:encoded><![CDATA[<p>@Michel,</p>
<p>IOC, solves this problem by removing global state. So I don&#8217;t think we are talking about the same thing.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michel Jung</title>
		<link>http://misko.hevery.com/2008/08/17/singletons-are-pathological-liars/comment-page-2/#comment-9185</link>
		<dc:creator>Michel Jung</dc:creator>
		<pubDate>Mon, 04 Jul 2011 12:39:24 +0000</pubDate>
		<guid isPermaLink="false">http://misko.hevery.com/?p=162#comment-9185</guid>
		<description>This is not only a singleton problem, but also an IOC issue. That&#039;s why I refuse to use IOC in my applications.</description>
		<content:encoded><![CDATA[<p>This is not only a singleton problem, but also an IOC issue. That&#8217;s why I refuse to use IOC in my applications.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Technical Presentations and Understanding the Little Things &#124; DaedTech</title>
		<link>http://misko.hevery.com/2008/08/17/singletons-are-pathological-liars/comment-page-2/#comment-8880</link>
		<dc:creator>Technical Presentations and Understanding the Little Things &#124; DaedTech</dc:creator>
		<pubDate>Thu, 16 Jun 2011 19:52:59 +0000</pubDate>
		<guid isPermaLink="false">http://misko.hevery.com/?p=162#comment-8880</guid>
		<description>[...] presentation, in particular, that struck me as effective had to do with singletons (he calls them pathological liars). In this talk (and in the linked post), he told a story about setting up a test for instantiating [...]</description>
		<content:encoded><![CDATA[<p>[...] presentation, in particular, that struck me as effective had to do with singletons (he calls them pathological liars). In this talk (and in the linked post), he told a story about setting up a test for instantiating [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Understanding the Robotlegs Injector: The Robots are Running the Factory &#124; RIA RockStars</title>
		<link>http://misko.hevery.com/2008/08/17/singletons-are-pathological-liars/comment-page-2/#comment-8528</link>
		<dc:creator>Understanding the Robotlegs Injector: The Robots are Running the Factory &#124; RIA RockStars</dc:creator>
		<pubDate>Tue, 31 May 2011 14:02:57 +0000</pubDate>
		<guid isPermaLink="false">http://misko.hevery.com/?p=162#comment-8528</guid>
		<description>[...] the same Object and know it was the same Object. But it turns out that this has a number of problems. The goal of the Singleton pattern was to make sure one instance of an object is created in the [...]</description>
		<content:encoded><![CDATA[<p>[...] the same Object and know it was the same Object. But it turns out that this has a number of problems. The goal of the Singleton pattern was to make sure one instance of an object is created in the [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Revolução Java - Artigos, Tutoriais, Livros e Dicas atualizadas sobre o Mundo Java!</title>
		<link>http://misko.hevery.com/2008/08/17/singletons-are-pathological-liars/comment-page-2/#comment-8505</link>
		<dc:creator>Revolução Java - Artigos, Tutoriais, Livros e Dicas atualizadas sobre o Mundo Java!</dc:creator>
		<pubDate>Mon, 30 May 2011 14:58:32 +0000</pubDate>
		<guid isPermaLink="false">http://misko.hevery.com/?p=162#comment-8505</guid>
		<description>[...] design patterns, I think Singleton has the worst reputation. They have been called “evil,” “liars” and even “stupid,” and for good [...]</description>
		<content:encoded><![CDATA[<p>[...] design patterns, I think Singleton has the worst reputation. They have been called “evil,” “liars” and even “stupid,” and for good [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>

