<?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: More on Abstract Classes in AS3</title>
	<atom:link href="http://www.bit-101.com/blog/?feed=rss2&#038;p=1236" rel="self" type="application/rss+xml" />
	<link>http://www.bit-101.com/blog/?p=1236</link>
	<description>Bill Gates Touched My Mac Book Pro</description>
	<lastBuildDate>Mon, 06 Sep 2010 16:48:34 -0700</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>By: Abstract Classes in AS3 at AlecMcE.com</title>
		<link>http://www.bit-101.com/blog/?p=1236#comment-8530</link>
		<dc:creator>Abstract Classes in AS3 at AlecMcE.com</dc:creator>
		<pubDate>Wed, 29 Jul 2009 13:04:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.bit-101.com/blog/?p=1236#comment-8530</guid>
		<description>[...] a new library at work, we were pondering what was the best strategy for abstract classes. Despite arguments to the contrary, we respectfully believe that abstract classes are useful! A quick Google search produces a lot of [...]</description>
		<content:encoded><![CDATA[<p>[...] a new library at work, we were pondering what was the best strategy for abstract classes. Despite arguments to the contrary, we respectfully believe that abstract classes are useful! A quick Google search produces a lot of [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kp</title>
		<link>http://www.bit-101.com/blog/?p=1236#comment-8529</link>
		<dc:creator>kp</dc:creator>
		<pubDate>Sat, 14 Feb 2009 15:22:33 +0000</pubDate>
		<guid isPermaLink="false">http://www.bit-101.com/blog/?p=1236#comment-8529</guid>
		<description>no problem at all Nick. I&#039;m glad to have ideas shared. Also added your feed to my netvibes, Looks like you have some interesting stuff there.</description>
		<content:encoded><![CDATA[<p>no problem at all Nick. I&#8217;m glad to have ideas shared. Also added your feed to my netvibes, Looks like you have some interesting stuff there.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nick Wiggill</title>
		<link>http://www.bit-101.com/blog/?p=1236#comment-8528</link>
		<dc:creator>Nick Wiggill</dc:creator>
		<pubDate>Sat, 14 Feb 2009 15:12:08 +0000</pubDate>
		<guid isPermaLink="false">http://www.bit-101.com/blog/?p=1236#comment-8528</guid>
		<description>Oh and a little more...

@Keith, I couldn&#039;t agree more, really. Eliminating derived class cruft is a worthy goal but sometimes (particularly when you doing &quot;evolutionary&quot; development as is the Agile way), it is very difficult to *know* what to shift up to a base/abstract class, and what to keep in the derived classes, until you&#039;ve actually used the thing a bit and it starts to show the form it wants to take, if you can excuse the anthropomorphism.

@Mike Welsh post -- In regards to the rest of your post (which I didn&#039;t read fully the first time!) I completely agree, having implemented an MVC game framework in that way myself. It is without doubt the cleanest method, if and when you are able to take the time on it. Sadly, the DisplayObject paradigm in ActionScript confuses a lot of developers in terms of separating controller logic from display logic, and for starting game developers this is really a bad thing if they plan to move onto bigger and better things than Flash games.

Thanks to all for some</description>
		<content:encoded><![CDATA[<p>Oh and a little more&#8230;</p>
<p>@Keith, I couldn&#8217;t agree more, really. Eliminating derived class cruft is a worthy goal but sometimes (particularly when you doing &#8220;evolutionary&#8221; development as is the Agile way), it is very difficult to *know* what to shift up to a base/abstract class, and what to keep in the derived classes, until you&#8217;ve actually used the thing a bit and it starts to show the form it wants to take, if you can excuse the anthropomorphism.</p>
<p>@Mike Welsh post &#8212; In regards to the rest of your post (which I didn&#8217;t read fully the first time!) I completely agree, having implemented an MVC game framework in that way myself. It is without doubt the cleanest method, if and when you are able to take the time on it. Sadly, the DisplayObject paradigm in ActionScript confuses a lot of developers in terms of separating controller logic from display logic, and for starting game developers this is really a bad thing if they plan to move onto bigger and better things than Flash games.</p>
<p>Thanks to all for some</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nick Wiggill</title>
		<link>http://www.bit-101.com/blog/?p=1236#comment-8527</link>
		<dc:creator>Nick Wiggill</dc:creator>
		<pubDate>Sat, 14 Feb 2009 14:48:47 +0000</pubDate>
		<guid isPermaLink="false">http://www.bit-101.com/blog/?p=1236#comment-8527</guid>
		<description>In response to what Mike Welsh said (and probably of interest to other game devs reading these comments), I don&#039;t I entirely agree, and I think that&#039;s rather a broad and sweeping statement. The example you&#039;ve given makes sense, but a game object can be a lot of different things. There are implementations (like one I&#039;m working on right now) where a game object can be a lot of different things (&quot;has-a&quot; vs &quot;is-a&quot;) at once. For example think of a racing game where you have all sorts of different cars made up of different components that you have bought. This car is assembled from these components (even if not in the more physical sense), eg. it has a particular type of gearbox, particular spoilers, mags, tyres, engine, supercharger etc. There are far too many possible permutations here to predict, thus inheritance is out the window for this type of scenario.

Here is a post on my blog discussing the matter of composition in game frameworks: http://www.visualharmonics.co.uk/actionscript-3/using-function-closures-in-object-composition/

(Hope you don&#039;t mind Keith)

Regards,

-Nick</description>
		<content:encoded><![CDATA[<p>In response to what Mike Welsh said (and probably of interest to other game devs reading these comments), I don&#8217;t I entirely agree, and I think that&#8217;s rather a broad and sweeping statement. The example you&#8217;ve given makes sense, but a game object can be a lot of different things. There are implementations (like one I&#8217;m working on right now) where a game object can be a lot of different things (&#8220;has-a&#8221; vs &#8220;is-a&#8221;) at once. For example think of a racing game where you have all sorts of different cars made up of different components that you have bought. This car is assembled from these components (even if not in the more physical sense), eg. it has a particular type of gearbox, particular spoilers, mags, tyres, engine, supercharger etc. There are far too many possible permutations here to predict, thus inheritance is out the window for this type of scenario.</p>
<p>Here is a post on my blog discussing the matter of composition in game frameworks: <a href="http://www.visualharmonics.co.uk/actionscript-3/using-function-closures-in-object-composition/" rel="nofollow">http://www.visualharmonics.co.uk/actionscript-3/using-function-closures-in-object-composition/</a></p>
<p>(Hope you don&#8217;t mind Keith)</p>
<p>Regards,</p>
<p>-Nick</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Cotton</title>
		<link>http://www.bit-101.com/blog/?p=1236#comment-8526</link>
		<dc:creator>Cotton</dc:creator>
		<pubDate>Tue, 27 May 2008 05:54:47 +0000</pubDate>
		<guid isPermaLink="false">http://www.bit-101.com/blog/?p=1236#comment-8526</guid>
		<description>Good news! I find out this in bugs.adobe.com, it seems the SDK team already working on it

To support full OOP: Abstract method [Status:Open ]
https://bugs.adobe.com/jira/browse/ASC-3379</description>
		<content:encoded><![CDATA[<p>Good news! I find out this in bugs.adobe.com, it seems the SDK team already working on it</p>
<p>To support full OOP: Abstract method [Status:Open ]<br />
<a href="https://bugs.adobe.com/jira/browse/ASC-3379" rel="nofollow">https://bugs.adobe.com/jira/browse/ASC-3379</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ekameleon</title>
		<link>http://www.bit-101.com/blog/?p=1236#comment-8525</link>
		<dc:creator>ekameleon</dc:creator>
		<pubDate>Fri, 16 May 2008 07:17:51 +0000</pubDate>
		<guid isPermaLink="false">http://www.bit-101.com/blog/?p=1236#comment-8525</guid>
		<description>Hello :)

For me ... not need of abstract class for the moment in AS3 :)

I prefere speak about &quot;helper&quot; class who implement one or more interfaces.

In VEGAS my framework opensource i use the &quot;getInstance()&quot; method like a &quot;Factory&quot; or a &quot;Locator&quot; method to returns one object singleton in my application. But i can continue to instanciate my class with the new keyword !

In other case, i use the &quot;getInstance()&quot; method with an argument &#039;id&#039; or &#039;name&#039; or &#039;channel&#039;... to returns &quot;multi-singleton&quot; objects of my class.

Example :

&lt;code&gt;

import flash.events.Event ;
import vegas.events.EventDispatcher ;

function testHandler1( e:Event ):void { trace(&quot;test1 : &quot; + e) } ;
function testHandler2( e:Event ):void { trace(&quot;test2 : &quot; + e) } ;

// register controllers in my application with multi FrontController singleton reference in my application (multi channel to dispatch the events in the global event flow)

FrontController.getInstance(&quot;channel1&quot;).insert( &quot;test1&quot; , testHandler1 ) ;

FrontController.getInstance(&quot;channel2&quot;).insert( &quot;test2&quot; , testHandler2 ) ;

// test - i dispatch the events in 2 channels in my application.

EventDispatcher.getInstance(&quot;channel1&quot;).dispatchEvent( new Event(&quot;test1&quot;) ) ;

EventDispatcher.getInstance(&quot;channel2&quot;).dispatchEvent( new Event(&quot;test2&quot;) ) ;

&lt;/code&gt;

I can instanciate my 2 class with the new keyword too ;) It&#039;s not a problem :)

EKA+ :)</description>
		<content:encoded><![CDATA[<p>Hello <img src='http://www.bit-101.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>For me &#8230; not need of abstract class for the moment in AS3 <img src='http://www.bit-101.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>I prefere speak about &#8220;helper&#8221; class who implement one or more interfaces.</p>
<p>In VEGAS my framework opensource i use the &#8220;getInstance()&#8221; method like a &#8220;Factory&#8221; or a &#8220;Locator&#8221; method to returns one object singleton in my application. But i can continue to instanciate my class with the new keyword !</p>
<p>In other case, i use the &#8220;getInstance()&#8221; method with an argument &#8216;id&#8217; or &#8216;name&#8217; or &#8216;channel&#8217;&#8230; to returns &#8220;multi-singleton&#8221; objects of my class.</p>
<p>Example :</p>
<p><code></p>
<p>import flash.events.Event ;<br />
import vegas.events.EventDispatcher ;</p>
<p>function testHandler1( e:Event ):void { trace("test1 : " + e) } ;<br />
function testHandler2( e:Event ):void { trace("test2 : " + e) } ;</p>
<p>// register controllers in my application with multi FrontController singleton reference in my application (multi channel to dispatch the events in the global event flow)</p>
<p>FrontController.getInstance("channel1").insert( "test1" , testHandler1 ) ;</p>
<p>FrontController.getInstance("channel2").insert( "test2" , testHandler2 ) ;</p>
<p>// test - i dispatch the events in 2 channels in my application.</p>
<p>EventDispatcher.getInstance("channel1").dispatchEvent( new Event("test1") ) ;</p>
<p>EventDispatcher.getInstance("channel2").dispatchEvent( new Event("test2") ) ;</p>
<p></code></p>
<p>I can instanciate my 2 class with the new keyword too <img src='http://www.bit-101.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  It&#8217;s not a problem <img src='http://www.bit-101.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>EKA+ <img src='http://www.bit-101.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Iain</title>
		<link>http://www.bit-101.com/blog/?p=1236#comment-8524</link>
		<dc:creator>Iain</dc:creator>
		<pubDate>Fri, 18 Apr 2008 22:03:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.bit-101.com/blog/?p=1236#comment-8524</guid>
		<description>Troy and Mike - thanks for the feedback, it&#039;s good to know I&#039;m on the right track with this. Where I use inheritance in complex games I end up having to dynamic cast alot, and also end up overriding half the code in my base classes, and it seems &quot;messy&quot;. Much better to divide the code into reusable &quot;behavior&quot; objects (memories of Director!). I&#039;m thinking that my code should look something like this:

if (gameObject.movable)
     gameObject.movable.move(5, 5);

One thing I&#039;m not sure of - should I have a variable in my base class (initially set to null) for every possible behavior? Do I only need one base class?

Someone needs to write a tutorial about object composition / aggregation as it relates specifically to Flash (and esp. games). I&#039;ve read a bit about this for C++ games but never for Flash games.</description>
		<content:encoded><![CDATA[<p>Troy and Mike &#8211; thanks for the feedback, it&#8217;s good to know I&#8217;m on the right track with this. Where I use inheritance in complex games I end up having to dynamic cast alot, and also end up overriding half the code in my base classes, and it seems &#8220;messy&#8221;. Much better to divide the code into reusable &#8220;behavior&#8221; objects (memories of Director!). I&#8217;m thinking that my code should look something like this:</p>
<p>if (gameObject.movable)<br />
     gameObject.movable.move(5, 5);</p>
<p>One thing I&#8217;m not sure of &#8211; should I have a variable in my base class (initially set to null) for every possible behavior? Do I only need one base class?</p>
<p>Someone needs to write a tutorial about object composition / aggregation as it relates specifically to Flash (and esp. games). I&#8217;ve read a bit about this for C++ games but never for Flash games.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Troy Gilbert</title>
		<link>http://www.bit-101.com/blog/?p=1236#comment-8523</link>
		<dc:creator>Troy Gilbert</dc:creator>
		<pubDate>Fri, 18 Apr 2008 19:00:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.bit-101.com/blog/?p=1236#comment-8523</guid>
		<description>It&#039;d be nice if AS3 had abstract classes, but largely for the same reasons it&#039;d be nice if it had multiple inheritance: to save typing. Sometimes you want to create base class that holds functionality for a tree of classes but the base class doesn&#039;t actually do everything it needs to do usefully (DisplayObject and DisplayObjectContainer are *excellent* examples of this). Same with multiple inheritance: I hate it when used a poor replacement for composition, but its a quick-n-easy way to get mix-in functionality.

In regards to games: composition is *way* more favorable to inheritance. In our new game making app, all game objects are decomposed into actions that are composited together. Technically, its implemented as a decorator pattern to make conflict resolution easier, but if the target audience was programmers it&#039;d be a generic object composition framework. Flash&#039;s native event system is *really* handy for these composition frameworks, to the point where I&#039;ve experimented with have all behavioral components subclass Sprite and be literal children of their game object to automagically handle input event propogation, etc.</description>
		<content:encoded><![CDATA[<p>It&#8217;d be nice if AS3 had abstract classes, but largely for the same reasons it&#8217;d be nice if it had multiple inheritance: to save typing. Sometimes you want to create base class that holds functionality for a tree of classes but the base class doesn&#8217;t actually do everything it needs to do usefully (DisplayObject and DisplayObjectContainer are *excellent* examples of this). Same with multiple inheritance: I hate it when used a poor replacement for composition, but its a quick-n-easy way to get mix-in functionality.</p>
<p>In regards to games: composition is *way* more favorable to inheritance. In our new game making app, all game objects are decomposed into actions that are composited together. Technically, its implemented as a decorator pattern to make conflict resolution easier, but if the target audience was programmers it&#8217;d be a generic object composition framework. Flash&#8217;s native event system is *really* handy for these composition frameworks, to the point where I&#8217;ve experimented with have all behavioral components subclass Sprite and be literal children of their game object to automagically handle input event propogation, etc.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kp</title>
		<link>http://www.bit-101.com/blog/?p=1236#comment-8522</link>
		<dc:creator>kp</dc:creator>
		<pubDate>Fri, 18 Apr 2008 11:56:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.bit-101.com/blog/?p=1236#comment-8522</guid>
		<description>Ewan, I&#039;m not saying they aren&#039;t useful. Not saying they shouldn&#039;t be there. But they aren&#039;t there. And &quot;useful&quot; doesn&#039;t mean &quot;you couldn&#039;t possibly do without them&quot; or &quot;ActionScript is not a &#039;real&#039; OO language because it doesn&#039;t have them&quot;</description>
		<content:encoded><![CDATA[<p>Ewan, I&#8217;m not saying they aren&#8217;t useful. Not saying they shouldn&#8217;t be there. But they aren&#8217;t there. And &#8220;useful&#8221; doesn&#8217;t mean &#8220;you couldn&#8217;t possibly do without them&#8221; or &#8220;ActionScript is not a &#8216;real&#8217; OO language because it doesn&#8217;t have them&#8221;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ewan</title>
		<link>http://www.bit-101.com/blog/?p=1236#comment-8521</link>
		<dc:creator>Ewan</dc:creator>
		<pubDate>Fri, 18 Apr 2008 00:02:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.bit-101.com/blog/?p=1236#comment-8521</guid>
		<description>Abstract classes are freaking useful.  That&#039;s why they exist in other programming languages - they should also exist in ActionScript.

The same goes for Singletons.  Why is it that you could make a constructor private in AS2 but not AS3 - it&#039;s nuts.</description>
		<content:encoded><![CDATA[<p>Abstract classes are freaking useful.  That&#8217;s why they exist in other programming languages &#8211; they should also exist in ActionScript.</p>
<p>The same goes for Singletons.  Why is it that you could make a constructor private in AS2 but not AS3 &#8211; it&#8217;s nuts.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
