<?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: Singleton&#8217;s new Tinfoil Hat called &#8220;Don&#8217;t clone me!&#8221;</title>
	<atom:link href="http://www.digizenstudio.com/blog/2007/02/26/singletons-new-tinfoil-hat-called-dont-clone-me/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.digizenstudio.com/blog/2007/02/26/singletons-new-tinfoil-hat-called-dont-clone-me/</link>
	<description>Jing Xue's Weblog</description>
	<pubDate>Tue, 06 Jan 2009 22:51:19 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Howard D'Souza</title>
		<link>http://www.digizenstudio.com/blog/2007/02/26/singletons-new-tinfoil-hat-called-dont-clone-me/comment-page-1/#comment-30319</link>
		<dc:creator>Howard D'Souza</dc:creator>
		<pubDate>Fri, 02 Mar 2007 21:52:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.digizenstudio.com/blog/2007/02/26/singletons-new-tinfoil-hat-called-dont-clone-me/#comment-30319</guid>
		<description>Avoiding implementing Cloneable is easy. A bigger problem arises with Serializable. I could argue that it is sometimes necessary for a singleton to implement Serializable (though I could argue the flip side just as easily). Implementing cloning through in-memory (de)serialization is not only more robust, but ensures deep copying of fields. So... pop quiz. How does one prevent cloning of Serializable singletons.
Answer: Don't try.
If you think of design patterns as something that makes your life easier, but you need to cooperate for it to work - you won't be so concerned about playing Singleton-nazi.
Just put a caveat-emptor in your Javadoc and move on to the next candidate :-)</description>
		<content:encoded><![CDATA[<p>Avoiding implementing Cloneable is easy. A bigger problem arises with Serializable. I could argue that it is sometimes necessary for a singleton to implement Serializable (though I could argue the flip side just as easily). Implementing cloning through in-memory (de)serialization is not only more robust, but ensures deep copying of fields. So&#8230; pop quiz. How does one prevent cloning of Serializable singletons.<br />
Answer: Don&#8217;t try.<br />
If you think of design patterns as something that makes your life easier, but you need to cooperate for it to work - you won&#8217;t be so concerned about playing Singleton-nazi.<br />
Just put a caveat-emptor in your Javadoc and move on to the next candidate <img src='http://www.digizenstudio.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jing Xue</title>
		<link>http://www.digizenstudio.com/blog/2007/02/26/singletons-new-tinfoil-hat-called-dont-clone-me/comment-page-1/#comment-29966</link>
		<dc:creator>Jing Xue</dc:creator>
		<pubDate>Tue, 27 Feb 2007 18:16:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.digizenstudio.com/blog/2007/02/26/singletons-new-tinfoil-hat-called-dont-clone-me/#comment-29966</guid>
		<description>LOL, yes, Ricky, you can have my job. :)

I should have probably added that I ask that question a lot in interviews, not because I want to encourage singletons, but because it's something most developers know about, and can act as a good platform for some more interesting follow-up questions regarding design patterns and multi-threading issues, etc.</description>
		<content:encoded><![CDATA[<p>LOL, yes, Ricky, you can have my job. <img src='http://www.digizenstudio.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>I should have probably added that I ask that question a lot in interviews, not because I want to encourage singletons, but because it&#8217;s something most developers know about, and can act as a good platform for some more interesting follow-up questions regarding design patterns and multi-threading issues, etc.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ricky Clarkson</title>
		<link>http://www.digizenstudio.com/blog/2007/02/26/singletons-new-tinfoil-hat-called-dont-clone-me/comment-page-1/#comment-29939</link>
		<dc:creator>Ricky Clarkson</dc:creator>
		<pubDate>Tue, 27 Feb 2007 13:46:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.digizenstudio.com/blog/2007/02/26/singletons-new-tinfoil-hat-called-dont-clone-me/#comment-29939</guid>
		<description>I would implement a singleton as a bag of static things, unless it needed to implement some interface.  That shows it for what it is commonly used for, a set of global variables.

Then I would remove it from my code, before the smell gets too bad.

Do I get the job?</description>
		<content:encoded><![CDATA[<p>I would implement a singleton as a bag of static things, unless it needed to implement some interface.  That shows it for what it is commonly used for, a set of global variables.</p>
<p>Then I would remove it from my code, before the smell gets too bad.</p>
<p>Do I get the job?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
