<?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: How to write a singleton class in javascript</title>
	<atom:link href="http://www.javascriptkata.com/2009/09/30/how-to-write-a-singleton-class-in-javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.javascriptkata.com/2009/09/30/how-to-write-a-singleton-class-in-javascript/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=how-to-write-a-singleton-class-in-javascript</link>
	<description>helping you with javascript since 2007</description>
	<lastBuildDate>Tue, 31 Jan 2012 11:22:00 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Irimaniumnops</title>
		<link>http://www.javascriptkata.com/2009/09/30/how-to-write-a-singleton-class-in-javascript/comment-page-1/#comment-1388</link>
		<dc:creator>Irimaniumnops</dc:creator>
		<pubDate>Thu, 13 Oct 2011 11:56:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.javascriptkata.com/?p=166#comment-1388</guid>
		<description>&lt;strong&gt;Websites worth visiting...&lt;/strong&gt;

[...]here are some links to sites that we link to because we think they are worth visiting[...]…...</description>
		<content:encoded><![CDATA[<p><strong>Websites worth visiting&#8230;</strong></p>
<p>[...]here are some links to sites that we link to because we think they are worth visiting[...]…&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: software reviews</title>
		<link>http://www.javascriptkata.com/2009/09/30/how-to-write-a-singleton-class-in-javascript/comment-page-1/#comment-1376</link>
		<dc:creator>software reviews</dc:creator>
		<pubDate>Thu, 13 Oct 2011 00:25:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.javascriptkata.com/?p=166#comment-1376</guid>
		<description>&lt;strong&gt;2011...&lt;/strong&gt;

Thank you for sharing excellent informations. Your web-site is very cool. I am impressed by the details that you have on this site. It reveals how nicely you understand this subject. Bookmarked this website page, will come back for more articles. You, ...</description>
		<content:encoded><![CDATA[<p><strong>2011&#8230;</strong></p>
<p>Thank you for sharing excellent informations. Your web-site is very cool. I am impressed by the details that you have on this site. It reveals how nicely you understand this subject. Bookmarked this website page, will come back for more articles. You, &#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dYcxcgcvfgg</title>
		<link>http://www.javascriptkata.com/2009/09/30/how-to-write-a-singleton-class-in-javascript/comment-page-1/#comment-1321</link>
		<dc:creator>dYcxcgcvfgg</dc:creator>
		<pubDate>Sun, 09 Oct 2011 03:32:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.javascriptkata.com/?p=166#comment-1321</guid>
		<description>&lt;strong&gt;2011...&lt;/strong&gt;

We are a group of volunteers and starting a new scheme in our community. Your web site offered us with valuable information to work on. You have done an impressive job and our whole community will be grateful to you....</description>
		<content:encoded><![CDATA[<p><strong>2011&#8230;</strong></p>
<p>We are a group of volunteers and starting a new scheme in our community. Your web site offered us with valuable information to work on. You have done an impressive job and our whole community will be grateful to you&#8230;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dYcxcgcvf</title>
		<link>http://www.javascriptkata.com/2009/09/30/how-to-write-a-singleton-class-in-javascript/comment-page-1/#comment-1291</link>
		<dc:creator>dYcxcgcvf</dc:creator>
		<pubDate>Sat, 08 Oct 2011 03:25:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.javascriptkata.com/?p=166#comment-1291</guid>
		<description>&lt;strong&gt;2011...&lt;/strong&gt;

I would like to thank you for the efforts you have put in writing this website. I am hoping the same high-grade web site post from you in the upcoming as well. In fact your creative writing abilities has inspired me to get my own website now. Actually ...</description>
		<content:encoded><![CDATA[<p><strong>2011&#8230;</strong></p>
<p>I would like to thank you for the efforts you have put in writing this website. I am hoping the same high-grade web site post from you in the upcoming as well. In fact your creative writing abilities has inspired me to get my own website now. Actually &#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lucas F.</title>
		<link>http://www.javascriptkata.com/2009/09/30/how-to-write-a-singleton-class-in-javascript/comment-page-1/#comment-1197</link>
		<dc:creator>Lucas F.</dc:creator>
		<pubDate>Wed, 25 May 2011 17:54:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.javascriptkata.com/?p=166#comment-1197</guid>
		<description>This singleton is not working propertly , when you say in line 6 you are using the Cats instance its not true, you are using a window instance, you are exposing the object as a global variable.&lt;br&gt;you can check this removing the the line 4 or adding the line for out of the Cat function you will see the Cat function is saving the singleton object in a global variable.</description>
		<content:encoded><![CDATA[<p>This singleton is not working propertly , when you say in line 6 you are using the Cats instance its not true, you are using a window instance, you are exposing the object as a global variable.<br />you can check this removing the the line 4 or adding the line for out of the Cat function you will see the Cat function is saving the singleton object in a global variable.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mrathsfeld</title>
		<link>http://www.javascriptkata.com/2009/09/30/how-to-write-a-singleton-class-in-javascript/comment-page-1/#comment-928</link>
		<dc:creator>mrathsfeld</dc:creator>
		<pubDate>Mon, 05 Jul 2010 20:24:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.javascriptkata.com/?p=166#comment-928</guid>
		<description>This implementation is broken! &lt;br&gt;&lt;br&gt;The scope of the getInstance() function is Window. Therefore this.singletonInstance is actually Window.singletonInstance aka a super global. (This can be easily verified with Firebug.)&lt;br&gt;&lt;br&gt;Applying this implementation to multiple classes will result in all classes returning the same object!</description>
		<content:encoded><![CDATA[<p>This implementation is broken! </p>
<p>The scope of the getInstance() function is Window. Therefore this.singletonInstance is actually Window.singletonInstance aka a super global. (This can be easily verified with Firebug.)</p>
<p>Applying this implementation to multiple classes will result in all classes returning the same object!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: simaopig</title>
		<link>http://www.javascriptkata.com/2009/09/30/how-to-write-a-singleton-class-in-javascript/comment-page-1/#comment-907</link>
		<dc:creator>simaopig</dc:creator>
		<pubDate>Wed, 05 May 2010 17:54:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.javascriptkata.com/?p=166#comment-907</guid>
		<description>It&#039;s nice singleton demo.&lt;br&gt;&lt;br&gt;And it is a lazy loading type. Very nice.</description>
		<content:encoded><![CDATA[<p>It&#39;s nice singleton demo.</p>
<p>And it is a lazy loading type. Very nice.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: KooiInc</title>
		<link>http://www.javascriptkata.com/2009/09/30/how-to-write-a-singleton-class-in-javascript/comment-page-1/#comment-849</link>
		<dc:creator>KooiInc</dc:creator>
		<pubDate>Mon, 23 Nov 2009 17:02:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.javascriptkata.com/?p=166#comment-849</guid>
		<description>You could rewrite this (for more efficiency):

function Cats(){
    var names = [],
        proto = arguments.callee.prototype;
    if (!proto._initiated){
      proto.add = function(name) {
        names.push(name);
        return this.names();
      };
      proto.names = function() {
        return names;
      };
      proto._initiated = true;
    }
    return this;
}</description>
		<content:encoded><![CDATA[<p>You could rewrite this (for more efficiency):</p>
<p>function Cats(){<br />
    var names = [],<br />
        proto = arguments.callee.prototype;<br />
    if (!proto._initiated){<br />
      proto.add = function(name) {<br />
        names.push(name);<br />
        return this.names();<br />
      };<br />
      proto.names = function() {<br />
        return names;<br />
      };<br />
      proto._initiated = true;<br />
    }<br />
    return this;<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: trice22</title>
		<link>http://www.javascriptkata.com/2009/09/30/how-to-write-a-singleton-class-in-javascript/comment-page-1/#comment-804</link>
		<dc:creator>trice22</dc:creator>
		<pubDate>Mon, 05 Oct 2009 11:12:19 +0000</pubDate>
		<guid isPermaLink="false">http://www.javascriptkata.com/?p=166#comment-804</guid>
		<description>Could you explain how this is supposed to be used?

This doesn&#039;t do much:

var foo = new Cats();
var bar = new Cats();

foo.add(&quot;Joe&quot;);
bar.add(&quot;Bert&quot;);

foo.names() // =&gt;  [&quot;Joe&quot;]

Cheers.</description>
		<content:encoded><![CDATA[<p>Could you explain how this is supposed to be used?</p>
<p>This doesn&#8217;t do much:</p>
<p>var foo = new Cats();<br />
var bar = new Cats();</p>
<p>foo.add(&#8220;Joe&#8221;);<br />
bar.add(&#8220;Bert&#8221;);</p>
<p>foo.names() // =&gt;  ["Joe"]</p>
<p>Cheers.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: How to make a singleton in javascript &#124; Javascript Kata</title>
		<link>http://www.javascriptkata.com/2009/09/30/how-to-write-a-singleton-class-in-javascript/comment-page-1/#comment-800</link>
		<dc:creator>How to make a singleton in javascript &#124; Javascript Kata</dc:creator>
		<pubDate>Thu, 01 Oct 2009 15:10:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.javascriptkata.com/?p=166#comment-800</guid>
		<description>[...] How to make a singleton in javascript   April 4, 2007 by Dan Simard black belt, object-oriented &#124; 23 comments        [UPDATE : This post is outdated. Check out the new post on singletons.] [...]</description>
		<content:encoded><![CDATA[<p>[...] How to make a singleton in javascript   April 4, 2007 by Dan Simard black belt, object-oriented | 23 comments        [UPDATE : This post is outdated. Check out the new post on singletons.] [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>

