<?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/</link>
	<description>Advanced katas for javascripters</description>
	<lastBuildDate>Fri, 30 Jul 2010 18:10:52 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	<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>
	<item>
		<title>By: JavaScript Countdown Timer</title>
		<link>http://www.javascriptkata.com/2009/09/30/how-to-write-a-singleton-class-in-javascript/comment-page-1/#comment-798</link>
		<dc:creator>JavaScript Countdown Timer</dc:creator>
		<pubDate>Thu, 01 Oct 2009 03:20:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.javascriptkata.com/?p=166#comment-798</guid>
		<description>very cool &amp; good tip, thank you very much for sharing.

Can I &lt;a href=&quot;http://www.javascriptbank.com/submit/&quot; rel=&quot;nofollow&quot;&gt;share this snippet&lt;/a&gt; on my JavaScript library?


Awaiting your response. Thank</description>
		<content:encoded><![CDATA[<p>very cool &amp; good tip, thank you very much for sharing.</p>
<p>Can I <a href="http://www.javascriptbank.com/submit/" rel="nofollow">share this snippet</a> on my JavaScript library?</p>
<p>Awaiting your response. Thank</p>
]]></content:encoded>
	</item>
</channel>
</rss>
