<?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 Factory</title>
	<atom:link href="http://www.richardlord.net/blog/singleton-factory/feed" rel="self" type="application/rss+xml" />
	<link>http://www.richardlord.net/blog/singleton-factory</link>
	<description>Actionscript/Flex, PHP and Java developer</description>
	<lastBuildDate>Sat, 24 Jul 2010 00:46:07 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	<item>
		<title>By: sascha/hdrs</title>
		<link>http://www.richardlord.net/blog/singleton-factory/comment-page-1#comment-24660</link>
		<dc:creator>sascha/hdrs</dc:creator>
		<pubDate>Sat, 11 Aug 2007 06:30:43 +0000</pubDate>
		<guid isPermaLink="false">http://www.bigroom.co.uk/blog/singleton-factory/#comment-24660</guid>
		<description>Yes it works now! Thanks a lot!</description>
		<content:encoded><![CDATA[<p>Yes it works now! Thanks a lot!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: richard</title>
		<link>http://www.richardlord.net/blog/singleton-factory/comment-page-1#comment-24289</link>
		<dc:creator>richard</dc:creator>
		<pubDate>Wed, 08 Aug 2007 11:35:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.bigroom.co.uk/blog/singleton-factory/#comment-24289</guid>
		<description>Sascha. That should work. Did you remember to set the function access to public - as with classes it will default to internal.</description>
		<content:encoded><![CDATA[<p>Sascha. That should work. Did you remember to set the function access to public &#8211; as with classes it will default to internal.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sascha/hdrs</title>
		<link>http://www.richardlord.net/blog/singleton-factory/comment-page-1#comment-24268</link>
		<dc:creator>sascha/hdrs</dc:creator>
		<pubDate>Wed, 08 Aug 2007 09:19:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.bigroom.co.uk/blog/singleton-factory/#comment-24268</guid>
		<description>Great stuff but isn&#039;t it possible to have the package function in a different package than the top-level? Say I want to keep a file named SingletonFactory.as that holds the function and is in the com.foo.app.patterns package? Seems not to work like that here, at least I get an error that the function/package is not found.</description>
		<content:encoded><![CDATA[<p>Great stuff but isn&#8217;t it possible to have the package function in a different package than the top-level? Say I want to keep a file named SingletonFactory.as that holds the function and is in the com.foo.app.patterns package? Seems not to work like that here, at least I get an error that the function/package is not found.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: richard</title>
		<link>http://www.richardlord.net/blog/singleton-factory/comment-page-1#comment-22173</link>
		<dc:creator>richard</dc:creator>
		<pubDate>Fri, 27 Jul 2007 13:55:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.bigroom.co.uk/blog/singleton-factory/#comment-22173</guid>
		<description>Keith: The code has some similarities with a flyweight factory because both are factories for creating and tracking objects, but the details and uses are very different.

Benny: I hadn&#039;t thought of using a Dictionary - I&#039;m still not familiar with all the classes in AS3. It works well and gives more stable lookup times. I&#039;ve added your suggestion to the end of the post. Thanks.</description>
		<content:encoded><![CDATA[<p>Keith: The code has some similarities with a flyweight factory because both are factories for creating and tracking objects, but the details and uses are very different.</p>
<p>Benny: I hadn&#8217;t thought of using a Dictionary &#8211; I&#8217;m still not familiar with all the classes in AS3. It works well and gives more stable lookup times. I&#8217;ve added your suggestion to the end of the post. Thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: matt poole</title>
		<link>http://www.richardlord.net/blog/singleton-factory/comment-page-1#comment-22171</link>
		<dc:creator>matt poole</dc:creator>
		<pubDate>Fri, 27 Jul 2007 13:44:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.bigroom.co.uk/blog/singleton-factory/#comment-22171</guid>
		<description>Benny,

Thats just what I was going suggest , Im glad I read on a bit...</description>
		<content:encoded><![CDATA[<p>Benny,</p>
<p>Thats just what I was going suggest , Im glad I read on a bit&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Benny</title>
		<link>http://www.richardlord.net/blog/singleton-factory/comment-page-1#comment-22166</link>
		<dc:creator>Benny</dc:creator>
		<pubDate>Fri, 27 Jul 2007 13:16:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.bigroom.co.uk/blog/singleton-factory/#comment-22166</guid>
		<description>I find this an interessting idea and maybe the following code (not tested) could provide the unique identifier and direct lookup you would like?

&lt;code&gt;
package {	
 function Singleton(c:Class):* {	
  return c in instncs?instncs[c]:instncs[c]=new c(); 
 }
}
var instncs:Dictionary=new Dictionary(true);
&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>I find this an interessting idea and maybe the following code (not tested) could provide the unique identifier and direct lookup you would like?</p>
<p><code><br />
package {<br />
 function Singleton(c:Class):* {<br />
  return c in instncs?instncs[c]:instncs[c]=new c();<br />
 }<br />
}<br />
var instncs:Dictionary=new Dictionary(true);<br />
</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Keith Peters</title>
		<link>http://www.richardlord.net/blog/singleton-factory/comment-page-1#comment-22164</link>
		<dc:creator>Keith Peters</dc:creator>
		<pubDate>Fri, 27 Jul 2007 12:54:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.bigroom.co.uk/blog/singleton-factory/#comment-22164</guid>
		<description>Actually what you wrote is pretty similar to the flyweight implementation.</description>
		<content:encoded><![CDATA[<p>Actually what you wrote is pretty similar to the flyweight implementation.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
