<?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: Implementing Enumerated Types in ActionScript 3</title>
	<atom:link href="http://nodename.com/blog/2009/09/05/implementing-enumerated-types-in-actionscript-3/feed/" rel="self" type="application/rss+xml" />
	<link>http://nodename.com/blog/2009/09/05/implementing-enumerated-types-in-actionscript-3/</link>
	<description></description>
	<lastBuildDate>Sun, 22 Aug 2010 03:17:40 -0600</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	<item>
		<title>By: alan</title>
		<link>http://nodename.com/blog/2009/09/05/implementing-enumerated-types-in-actionscript-3/comment-page-1/#comment-169386</link>
		<dc:creator>alan</dc:creator>
		<pubDate>Wed, 12 May 2010 18:42:58 +0000</pubDate>
		<guid isPermaLink="false">http://nodename.com/blog/?p=363#comment-169386</guid>
		<description>I am now officially preferring Jackson&#039;s approach in comment #1, not only for the reasons he gives, but because by making that ENFORCER Object protected, I&#039;m able to implement enumerated subtypes!  More on this at a later date...</description>
		<content:encoded><![CDATA[<p>I am now officially preferring Jackson&#8217;s approach in comment #1, not only for the reasons he gives, but because by making that ENFORCER Object protected, I&#8217;m able to implement enumerated subtypes!  More on this at a later date&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Strategies For Global Data ( hey it happens&#8230; )- Touch My Blog</title>
		<link>http://nodename.com/blog/2009/09/05/implementing-enumerated-types-in-actionscript-3/comment-page-1/#comment-169233</link>
		<dc:creator>Strategies For Global Data ( hey it happens&#8230; )- Touch My Blog</dc:creator>
		<pubDate>Wed, 10 Feb 2010 21:46:32 +0000</pubDate>
		<guid isPermaLink="false">http://nodename.com/blog/?p=363#comment-169233</guid>
		<description>[...] more reading about enums in AS3 check out Alan Shaw&#8217;s post .   [...]</description>
		<content:encoded><![CDATA[<p>[...] more reading about enums in AS3 check out Alan Shaw&#8217;s post .   [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: alan</title>
		<link>http://nodename.com/blog/2009/09/05/implementing-enumerated-types-in-actionscript-3/comment-page-1/#comment-169200</link>
		<dc:creator>alan</dc:creator>
		<pubDate>Sat, 30 Jan 2010 16:58:40 +0000</pubDate>
		<guid isPermaLink="false">http://nodename.com/blog/?p=363#comment-169200</guid>
		<description>Thanks, Jackson.  I don&#039;t often discuss efficiency and optimization, and often it&#039;s at odds with making the code &quot;cleaner.&quot; 

I&#039;m in the midst of catching up on your blog, which is a must-read for AS3 programmers.</description>
		<content:encoded><![CDATA[<p>Thanks, Jackson.  I don&#8217;t often discuss efficiency and optimization, and often it&#8217;s at odds with making the code &#8220;cleaner.&#8221; </p>
<p>I&#8217;m in the midst of catching up on your blog, which is a must-read for AS3 programmers.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jackson Dunstan</title>
		<link>http://nodename.com/blog/2009/09/05/implementing-enumerated-types-in-actionscript-3/comment-page-1/#comment-169198</link>
		<dc:creator>Jackson Dunstan</dc:creator>
		<pubDate>Sat, 30 Jan 2010 08:23:08 +0000</pubDate>
		<guid isPermaLink="false">http://nodename.com/blog/?p=363#comment-169198</guid>
		<description>I really like this technique, especially because you don&#039;t need to instantiate the PailContents for each enum object you need. This means you can skip the expensive constructor and keep the number of objects limited to the number of enum values. One thing though: when implementing singletons via a pseudo-private constructor as you have I prefer this approach:

class Classy
{
  private static const SINGLETON_ENFORCER:Object = {};
  public function Classy(enforcer:Object, ...)
  {
    if (enforcer != SINGLETON_ENFORCER)
    {
      throw new IllegalOperationError(...);
    }
  }
}

It&#039;s very close to what you have, but means that you don&#039;t need to create a whole class to enforce the &quot;private&quot; constructor but instead simply a static variable and an empty Object. This saves a little on SWF size and may even be a little quicker, though I haven&#039;t tested this and the error case is certainly not a performance-critical path. :)

Thanks for the link and for posting your AS3 version of the technique!</description>
		<content:encoded><![CDATA[<p>I really like this technique, especially because you don&#8217;t need to instantiate the PailContents for each enum object you need. This means you can skip the expensive constructor and keep the number of objects limited to the number of enum values. One thing though: when implementing singletons via a pseudo-private constructor as you have I prefer this approach:</p>
<p>class Classy<br />
{<br />
  private static const SINGLETON_ENFORCER:Object = {};<br />
  public function Classy(enforcer:Object, &#8230;)<br />
  {<br />
    if (enforcer != SINGLETON_ENFORCER)<br />
    {<br />
      throw new IllegalOperationError(&#8230;);<br />
    }<br />
  }<br />
}</p>
<p>It&#8217;s very close to what you have, but means that you don&#8217;t need to create a whole class to enforce the &#8220;private&#8221; constructor but instead simply a static variable and an empty Object. This saves a little on SWF size and may even be a little quicker, though I haven&#8217;t tested this and the error case is certainly not a performance-critical path. :)</p>
<p>Thanks for the link and for posting your AS3 version of the technique!</p>
]]></content:encoded>
	</item>
</channel>
</rss>
