<?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: The quest for the elusive &#8220;N-gleton&#8221;</title>
	<atom:link href="http://dispatchevent.org/mims/the-quest-for-the-elusive-n-gleton/feed/" rel="self" type="application/rss+xml" />
	<link>http://dispatchevent.org/mims/the-quest-for-the-elusive-n-gleton/</link>
	<description>Collective thoughts on the Flash Platform, iOS, Unity, and any other technology we use.</description>
	<lastBuildDate>Tue, 24 Jan 2012 12:18:11 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Jon Toland</title>
		<link>http://dispatchevent.org/mims/the-quest-for-the-elusive-n-gleton/comment-page-1/#comment-140092</link>
		<dc:creator>Jon Toland</dc:creator>
		<pubDate>Sat, 28 Feb 2009 02:26:12 +0000</pubDate>
		<guid isPermaLink="false">http://dispatchevent.org/?p=638#comment-140092</guid>
		<description>Thx for the 411 I like the way you implemented that suspect it&#039;ll come in handy next time.</description>
		<content:encoded><![CDATA[<p>Thx for the 411 I like the way you implemented that suspect it&#8217;ll come in handy next time.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mims H Wright</title>
		<link>http://dispatchevent.org/mims/the-quest-for-the-elusive-n-gleton/comment-page-1/#comment-140044</link>
		<dc:creator>Mims H Wright</dc:creator>
		<pubDate>Fri, 27 Feb 2009 18:21:09 +0000</pubDate>
		<guid isPermaLink="false">http://dispatchevent.org/?p=638#comment-140044</guid>
		<description>Hey Jon,

It does return the same instance if you use two strings with the same value (because of the way strings are evaluated in AS3) but it does not return the same instance if you use two different objects even if the objects contain the same data. So:
getInstance(&quot;foo&quot;) == getInstance(&quot;foo&quot;)
but
getInstance({name:&quot;foo&quot;}) != getInstance({name:&quot;foo&quot;})</description>
		<content:encoded><![CDATA[<p>Hey Jon,</p>
<p>It does return the same instance if you use two strings with the same value (because of the way strings are evaluated in AS3) but it does not return the same instance if you use two different objects even if the objects contain the same data. So:<br />
getInstance(&#8220;foo&#8221;) == getInstance(&#8220;foo&#8221;)<br />
but<br />
getInstance({name:&#8221;foo&#8221;}) != getInstance({name:&#8221;foo&#8221;})</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jon Toland</title>
		<link>http://dispatchevent.org/mims/the-quest-for-the-elusive-n-gleton/comment-page-1/#comment-139846</link>
		<dc:creator>Jon Toland</dc:creator>
		<pubDate>Thu, 26 Feb 2009 05:00:39 +0000</pubDate>
		<guid isPermaLink="false">http://dispatchevent.org/?p=638#comment-139846</guid>
		<description>Yeah multiton pattern.  For a use case and alternate implementation check out &lt;a href=&quot;http://trac.puremvc.org/PureMVC_AS3_MultiCore&quot; rel=&quot;nofollow&quot;&gt;Puremvc Multicore&lt;/a&gt; :)

I used this pattern this week to ensure only one JavaScript HTML editor was spawned by a given custom Flex TextArea instance.  Thus multiple pop-ups could be spawned but no more than a 1 to 1 ratio with associated components.

It is interesting that you used a Dictionary in lieu of a plain old Object.  Does it return the same instance if you try to use two different variables as keys that contain the same String?  That&#039;d be a zinger for flexibility if so.</description>
		<content:encoded><![CDATA[<p>Yeah multiton pattern.  For a use case and alternate implementation check out <a href="http://trac.puremvc.org/PureMVC_AS3_MultiCore" rel="nofollow">Puremvc Multicore</a> :)</p>
<p>I used this pattern this week to ensure only one JavaScript HTML editor was spawned by a given custom Flex TextArea instance.  Thus multiple pop-ups could be spawned but no more than a 1 to 1 ratio with associated components.</p>
<p>It is interesting that you used a Dictionary in lieu of a plain old Object.  Does it return the same instance if you try to use two different variables as keys that contain the same String?  That&#8217;d be a zinger for flexibility if so.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Paolo Iulita</title>
		<link>http://dispatchevent.org/mims/the-quest-for-the-elusive-n-gleton/comment-page-1/#comment-139751</link>
		<dc:creator>Paolo Iulita</dc:creator>
		<pubDate>Wed, 25 Feb 2009 08:55:20 +0000</pubDate>
		<guid isPermaLink="false">http://dispatchevent.org/?p=638#comment-139751</guid>
		<description>uhm.... your approach remember me the Factory pattern.
but, i can not imagine when it may be useful..
is there any case study for it?

ciao!</description>
		<content:encoded><![CDATA[<p>uhm&#8230;. your approach remember me the Factory pattern.<br />
but, i can not imagine when it may be useful..<br />
is there any case study for it?</p>
<p>ciao!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Grimesters</title>
		<link>http://dispatchevent.org/mims/the-quest-for-the-elusive-n-gleton/comment-page-1/#comment-139578</link>
		<dc:creator>Grimesters</dc:creator>
		<pubDate>Tue, 24 Feb 2009 10:41:26 +0000</pubDate>
		<guid isPermaLink="false">http://dispatchevent.org/?p=638#comment-139578</guid>
		<description>The pattern you are thinking of is the Multiton...
http://en.wikipedia.org/wiki/Multiton_pattern
A Singleton isn&#039;t a complicated global variable; you simply use the Singleton pattern when you want to enforce the existence of one and only one instance of an object, and of course an object is data and behaviour encapsulated. Confusing Singletons with globals shows a lack of understanding about what an object is. If there should only ever be one instance of a CommsManager class for example, make it a Singleton. This guards against other developers, who may be maintaining your code in years to come, mistakenly creating two instances.  If you are using your Singleton as some kind of glorified global variable then, yes, your object design is probably flawed - but I don&#039;t agree with blaming the pattern - blame the designer!</description>
		<content:encoded><![CDATA[<p>The pattern you are thinking of is the Multiton&#8230;<br />
<a href="http://en.wikipedia.org/wiki/Multiton_pattern" rel="nofollow">http://en.wikipedia.org/wiki/Multiton_pattern</a><br />
A Singleton isn&#8217;t a complicated global variable; you simply use the Singleton pattern when you want to enforce the existence of one and only one instance of an object, and of course an object is data and behaviour encapsulated. Confusing Singletons with globals shows a lack of understanding about what an object is. If there should only ever be one instance of a CommsManager class for example, make it a Singleton. This guards against other developers, who may be maintaining your code in years to come, mistakenly creating two instances.  If you are using your Singleton as some kind of glorified global variable then, yes, your object design is probably flawed &#8211; but I don&#8217;t agree with blaming the pattern &#8211; blame the designer!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kelvin Luck</title>
		<link>http://dispatchevent.org/mims/the-quest-for-the-elusive-n-gleton/comment-page-1/#comment-139562</link>
		<dc:creator>Kelvin Luck</dc:creator>
		<pubDate>Tue, 24 Feb 2009 08:35:35 +0000</pubDate>
		<guid isPermaLink="false">http://dispatchevent.org/?p=638#comment-139562</guid>
		<description>I used that pattern extensively in Flashr, my old AS2 wrapper for the flickr API. e.g. getPhoto in http://my-svn.assembla.com/svn/flashr/trunk/com/kelvinluck/flashr/core/Photo.as

It was very useful in that situation (where you know that a photo with a given ID will always refer to the same object) and meant that I could update the photo from anywhere and know that it would be updated everywhere...

I&#039;d be interested to know if the pattern does have a &quot;real&quot; name though.</description>
		<content:encoded><![CDATA[<p>I used that pattern extensively in Flashr, my old AS2 wrapper for the flickr API. e.g. getPhoto in <a href="http://my-svn.assembla.com/svn/flashr/trunk/com/kelvinluck/flashr/core/Photo.as" rel="nofollow">http://my-svn.assembla.com/svn/flashr/trunk/com/kelvinluck/flashr/core/Photo.as</a></p>
<p>It was very useful in that situation (where you know that a photo with a given ID will always refer to the same object) and meant that I could update the photo from anywhere and know that it would be updated everywhere&#8230;</p>
<p>I&#8217;d be interested to know if the pattern does have a &#8220;real&#8221; name though.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Patrick Pietens</title>
		<link>http://dispatchevent.org/mims/the-quest-for-the-elusive-n-gleton/comment-page-1/#comment-139559</link>
		<dc:creator>Patrick Pietens</dc:creator>
		<pubDate>Tue, 24 Feb 2009 07:57:42 +0000</pubDate>
		<guid isPermaLink="false">http://dispatchevent.org/?p=638#comment-139559</guid>
		<description>Personally I would never use something like this. If I want to limit the number of instances I would go for a Factory class.</description>
		<content:encoded><![CDATA[<p>Personally I would never use something like this. If I want to limit the number of instances I would go for a Factory class.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

