<?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: Runtime Enforcement of Abstract Classes in AS3</title>
	<atom:link href="http://joshblog.net/2007/08/19/enforcing-abstract-classes-at-runtime-in-actionscript-3/feed/" rel="self" type="application/rss+xml" />
	<link>http://joshblog.net/2007/08/19/enforcing-abstract-classes-at-runtime-in-actionscript-3/</link>
	<description>Josh Tynjala explores Flash, Flex, and ActionScript.</description>
	<lastBuildDate>Sat, 31 Jul 2010 02:55:11 -0400</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	<item>
		<title>By: Abstract Base Class</title>
		<link>http://joshblog.net/2007/08/19/enforcing-abstract-classes-at-runtime-in-actionscript-3/comment-page-1/#comment-71395</link>
		<dc:creator>Abstract Base Class</dc:creator>
		<pubDate>Mon, 31 May 2010 11:24:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.zeuslabs.us/2007/08/19/enforcing-abstract-classes-at-runtime-in-actionscript-3/#comment-71395</guid>
		<description>[...] mentioned by josh tynjala in Runtime Enforcement of Abstract Classes in AS3, abstract classes is not a feature of actionscript 3. in his section forcing implementation of [...]</description>
		<content:encoded><![CDATA[<p>[...] mentioned by josh tynjala in Runtime Enforcement of Abstract Classes in AS3, abstract classes is not a feature of actionscript 3. in his section forcing implementation of [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Taka Kojima</title>
		<link>http://joshblog.net/2007/08/19/enforcing-abstract-classes-at-runtime-in-actionscript-3/comment-page-1/#comment-65087</link>
		<dc:creator>Taka Kojima</dc:creator>
		<pubDate>Fri, 26 Mar 2010 23:15:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.zeuslabs.us/2007/08/19/enforcing-abstract-classes-at-runtime-in-actionscript-3/#comment-65087</guid>
		<description>I know this is quite an old post, but just wanted to share a thought after reading through the post and the comments.

You rank importance, in the following manner:

1. Reliability
2. Maintainability
3. Performance (this is NOT where most applications fall short or cost money)

I don&#039;t necessarily disagree with you, however sometimes you do have to sacrifice a lesser &quot;important&quot; bullet point for another.

One way to sort of compromise on this issue would be to set some sort of flag, that way introspection could be turned on/off at will.

Introspection in this case, only benefits you while you are developing. Having runtime introspection happening in a live, production release version of an application does you no good and it will just eat up unnecessary resources.

So, let&#039;s say you have a class, idk, let&#039;s just include this functionality as part of a Debugger class, so you have a static var Debugger.INTROSPECTION_LEVEL = &quot;2&quot;; // 0, 1 or 2

Where 2 would be the highest level of introspection, 1 would be basic level and 0 would be none at all.

This way, after you are done developing and ready to push a build, you just set Debugger.INTROSPECTION_LEVEL = 0 and all the performance issues go away.

Just thought I&#039;d share my two cents.</description>
		<content:encoded><![CDATA[<p>I know this is quite an old post, but just wanted to share a thought after reading through the post and the comments.</p>
<p>You rank importance, in the following manner:</p>
<p>1. Reliability<br />
2. Maintainability<br />
3. Performance (this is NOT where most applications fall short or cost money)</p>
<p>I don&#8217;t necessarily disagree with you, however sometimes you do have to sacrifice a lesser &#8220;important&#8221; bullet point for another.</p>
<p>One way to sort of compromise on this issue would be to set some sort of flag, that way introspection could be turned on/off at will.</p>
<p>Introspection in this case, only benefits you while you are developing. Having runtime introspection happening in a live, production release version of an application does you no good and it will just eat up unnecessary resources.</p>
<p>So, let&#8217;s say you have a class, idk, let&#8217;s just include this functionality as part of a Debugger class, so you have a static var Debugger.INTROSPECTION_LEVEL = &#8220;2&#8243;; // 0, 1 or 2</p>
<p>Where 2 would be the highest level of introspection, 1 would be basic level and 0 would be none at all.</p>
<p>This way, after you are done developing and ready to push a build, you just set Debugger.INTROSPECTION_LEVEL = 0 and all the performance issues go away.</p>
<p>Just thought I&#8217;d share my two cents.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jochen Szostek</title>
		<link>http://joshblog.net/2007/08/19/enforcing-abstract-classes-at-runtime-in-actionscript-3/comment-page-1/#comment-62179</link>
		<dc:creator>Jochen Szostek</dc:creator>
		<pubDate>Thu, 14 Jan 2010 14:43:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.zeuslabs.us/2007/08/19/enforcing-abstract-classes-at-runtime-in-actionscript-3/#comment-62179</guid>
		<description>It might be a while ago since you wrote this but still very interesting/inspiring to see someone so dedicated to create an abstract hack. Cool and will try to implement it anytime soon!

Greets</description>
		<content:encoded><![CDATA[<p>It might be a while ago since you wrote this but still very interesting/inspiring to see someone so dedicated to create an abstract hack. Cool and will try to implement it anytime soon!</p>
<p>Greets</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mikew909</title>
		<link>http://joshblog.net/2007/08/19/enforcing-abstract-classes-at-runtime-in-actionscript-3/comment-page-1/#comment-61493</link>
		<dc:creator>mikew909</dc:creator>
		<pubDate>Tue, 08 Sep 2009 07:49:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.zeuslabs.us/2007/08/19/enforcing-abstract-classes-at-runtime-in-actionscript-3/#comment-61493</guid>
		<description>Great Post!   i read that in order to use decorator pattern on Sprite/Movie Clip based objects you use a abstract-y class not a inteface def - i will try out your suggestion here</description>
		<content:encoded><![CDATA[<p>Great Post!   i read that in order to use decorator pattern on Sprite/Movie Clip based objects you use a abstract-y class not a inteface def &#8211; i will try out your suggestion here</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Abstract Classes in AS3 at AlecMcE.com</title>
		<link>http://joshblog.net/2007/08/19/enforcing-abstract-classes-at-runtime-in-actionscript-3/comment-page-1/#comment-61195</link>
		<dc:creator>Abstract Classes in AS3 at AlecMcE.com</dc:creator>
		<pubDate>Wed, 29 Jul 2009 13:06:19 +0000</pubDate>
		<guid isPermaLink="false">http://www.zeuslabs.us/2007/08/19/enforcing-abstract-classes-at-runtime-in-actionscript-3/#comment-61195</guid>
		<description>[...] Self Reference Approach @ JoshTalksFlash [...]</description>
		<content:encoded><![CDATA[<p>[...] Self Reference Approach @ JoshTalksFlash [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Phi</title>
		<link>http://joshblog.net/2007/08/19/enforcing-abstract-classes-at-runtime-in-actionscript-3/comment-page-1/#comment-60880</link>
		<dc:creator>Phi</dc:creator>
		<pubDate>Thu, 16 Apr 2009 09:58:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.zeuslabs.us/2007/08/19/enforcing-abstract-classes-at-runtime-in-actionscript-3/#comment-60880</guid>
		<description>As with most introspection I found describeType to be pretty expensive, so I recommend caching the results somewhere so that you don&#039;t need to call describeType twice for the same type.</description>
		<content:encoded><![CDATA[<p>As with most introspection I found describeType to be pretty expensive, so I recommend caching the results somewhere so that you don&#8217;t need to call describeType twice for the same type.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael</title>
		<link>http://joshblog.net/2007/08/19/enforcing-abstract-classes-at-runtime-in-actionscript-3/comment-page-1/#comment-60796</link>
		<dc:creator>Michael</dc:creator>
		<pubDate>Fri, 06 Mar 2009 14:39:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.zeuslabs.us/2007/08/19/enforcing-abstract-classes-at-runtime-in-actionscript-3/#comment-60796</guid>
		<description>First, thank you Josh for posting this.

Second, 
&lt;pre&gt;protected function doSomething(): void 
{
 throw new IllegalOperationError(â€This method must be implemented in the concrete class.â€);
}&lt;/pre&gt;

... is not the same as introspection as it does not produce an error until the function is called --- the worst possible case in my mind.

I agree with the other posters when they say that Adobe needs to provide an abstract class naively in the language, however, they do not and there are some things you need abstract classes to do (being a C# programmer professionally I really miss this functionality).

Additionally, I always see a good number of people complaining about the &quot;cost&quot; of introspection.  Honestly, I use it a lot and RARELY see a serious performance hit (in which case I disable and find another way).  However, I think it is backwards to consider performance first and functionality second (when performance is not necessarily going to be an issue).  In my not so humble opinion most developers focus WAY to much on performance given the power of the average PC/Server.  After getting your code to work, the important factors in order should be:

1. Reliability
2. Maintainability
3. Performance (this is NOT where most applications fall short or cost money)

On the other hand, I believe the compile time error is important and does address the first 2 issues.  Without that, the next best thing is to throw an exception at runtime and as soon as possible.  In fact, in my own solution, I use even MORE introspection and find all the classes that extend the &quot;MyConcreteType&quot; at initialization and throw exceptions BEFORE the application even fully starts.  This makes development, maintainance, etc pretty easy and adds only a mere second or two to my init process (unlike say drawing the controls which takes much longer =P)

Dont fear introspection!  I have seen a lot of slow buggy flash/flex applications and more often than not they are slow because of &quot;clever&quot; UI design decisions.</description>
		<content:encoded><![CDATA[<p>First, thank you Josh for posting this.</p>
<p>Second, </p>
<pre>protected function doSomething(): void
{
 throw new IllegalOperationError(â€This method must be implemented in the concrete class.â€);
}</pre>
<p>&#8230; is not the same as introspection as it does not produce an error until the function is called &#8212; the worst possible case in my mind.</p>
<p>I agree with the other posters when they say that Adobe needs to provide an abstract class naively in the language, however, they do not and there are some things you need abstract classes to do (being a C# programmer professionally I really miss this functionality).</p>
<p>Additionally, I always see a good number of people complaining about the &#8220;cost&#8221; of introspection.  Honestly, I use it a lot and RARELY see a serious performance hit (in which case I disable and find another way).  However, I think it is backwards to consider performance first and functionality second (when performance is not necessarily going to be an issue).  In my not so humble opinion most developers focus WAY to much on performance given the power of the average PC/Server.  After getting your code to work, the important factors in order should be:</p>
<p>1. Reliability<br />
2. Maintainability<br />
3. Performance (this is NOT where most applications fall short or cost money)</p>
<p>On the other hand, I believe the compile time error is important and does address the first 2 issues.  Without that, the next best thing is to throw an exception at runtime and as soon as possible.  In fact, in my own solution, I use even MORE introspection and find all the classes that extend the &#8220;MyConcreteType&#8221; at initialization and throw exceptions BEFORE the application even fully starts.  This makes development, maintainance, etc pretty easy and adds only a mere second or two to my init process (unlike say drawing the controls which takes much longer =P)</p>
<p>Dont fear introspection!  I have seen a lot of slow buggy flash/flex applications and more often than not they are slow because of &#8220;clever&#8221; UI design decisions.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joe B.</title>
		<link>http://joshblog.net/2007/08/19/enforcing-abstract-classes-at-runtime-in-actionscript-3/comment-page-1/#comment-60754</link>
		<dc:creator>Joe B.</dc:creator>
		<pubDate>Thu, 19 Feb 2009 18:11:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.zeuslabs.us/2007/08/19/enforcing-abstract-classes-at-runtime-in-actionscript-3/#comment-60754</guid>
		<description>Excellent post.  Thanks for sharing.  How about adding this function declaration to the abstract class to enforce concrete class implementation :


protected function doSomething(): void {
	throw new IllegalOperationError(&quot;This method must be implemented in the concrete class.&quot;);
}
</description>
		<content:encoded><![CDATA[<p>Excellent post.  Thanks for sharing.  How about adding this function declaration to the abstract class to enforce concrete class implementation :</p>
<p>protected function doSomething(): void {<br />
	throw new IllegalOperationError(&#8220;This method must be implemented in the concrete class.&#8221;);<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joe B.</title>
		<link>http://joshblog.net/2007/08/19/enforcing-abstract-classes-at-runtime-in-actionscript-3/comment-page-1/#comment-60753</link>
		<dc:creator>Joe B.</dc:creator>
		<pubDate>Thu, 19 Feb 2009 18:11:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.zeuslabs.us/2007/08/19/enforcing-abstract-classes-at-runtime-in-actionscript-3/#comment-60753</guid>
		<description>Excellent post.  Thanks for sharing.  How about adding this function declaration to the abstract class to enforce concrete class implementation :

&lt;pre&gt;protected function doSomething(): void {
	throw new IllegalOperationError(&quot;This method must be implemented in the concrete class.&quot;);
}&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>Excellent post.  Thanks for sharing.  How about adding this function declaration to the abstract class to enforce concrete class implementation :</p>
<pre>protected function doSomething(): void {
	throw new IllegalOperationError("This method must be implemented in the concrete class.");
}</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dykam</title>
		<link>http://joshblog.net/2007/08/19/enforcing-abstract-classes-at-runtime-in-actionscript-3/comment-page-1/#comment-60410</link>
		<dc:creator>Dykam</dc:creator>
		<pubDate>Thu, 11 Dec 2008 11:03:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.zeuslabs.us/2007/08/19/enforcing-abstract-classes-at-runtime-in-actionscript-3/#comment-60410</guid>
		<description>Eric, you are right. this will be only a little extra work...
Maybe I&#039;ll combine the two options. I&#039;ll see.</description>
		<content:encoded><![CDATA[<p>Eric, you are right. this will be only a little extra work&#8230;<br />
Maybe I&#8217;ll combine the two options. I&#8217;ll see.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
