<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/'><id>tag:blogger.com,1999:blog-3717133688018454834.post8979800612886095948..comments</id><updated>2009-11-27T14:05:24.382Z</updated><title type='text'>Comments on Iain Lobb: Do you extend or compose Sprite, MovieClip and Dis...</title><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://blog.iainlobb.com/feeds/8979800612886095948/comments/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3717133688018454834/8979800612886095948/comments/default'/><link rel='alternate' type='text/html' href='http://blog.iainlobb.com/2009/05/do-you-extend-or-compose-sprite.html'/><author><name>Iain</name><email>noreply@blogger.com</email></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>12</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-3717133688018454834.post-2170153982014675113</id><published>2009-11-27T14:05:24.382Z</published><updated>2009-11-27T14:05:24.382Z</updated><title type='text'>Hmmm, it's all very interesting. I must admit I us...</title><content type='html'>Hmmm, it&amp;#39;s all very interesting. I must admit I use inheritance at 99% and I am happy with this, sub classes are quite clean that way, I don&amp;#39;t need to reference all the methods that I need to use.&lt;br /&gt;&lt;br /&gt;I feel that I somehow must be missing the good sides of composition, or do something wrong, is there any good blog post about inheritance?&lt;br /&gt;&lt;br /&gt;Cheers,&lt;br /&gt;T</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3717133688018454834/8979800612886095948/comments/default/2170153982014675113'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3717133688018454834/8979800612886095948/comments/default/2170153982014675113'/><link rel='alternate' type='text/html' href='http://blog.iainlobb.com/2009/05/do-you-extend-or-compose-sprite.html?showComment=1259330724382#c2170153982014675113' title=''/><author><name>Og2t</name><uri>http://www.blogger.com/profile/04410544331962002380</uri><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.iainlobb.com/2009/05/do-you-extend-or-compose-sprite.html' ref='tag:blogger.com,1999:blog-3717133688018454834.post-8979800612886095948' source='http://www.blogger.com/feeds/3717133688018454834/posts/default/8979800612886095948' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-3717133688018454834.post-2858850668404196771</id><published>2009-06-14T11:05:44.030+01:00</published><updated>2009-06-14T11:05:44.030+01:00</updated><title type='text'>We can go back and forth but really this will boil...</title><content type='html'>We can go back and forth but really this will boil down to a matter that simply depends on the case. Where does the class fit conceptually, with AS3s &amp;quot;framework&amp;quot; or the one you make specific to your needs and tastes? If you are extending the movieclip or sprite -merely- because it will be a visible object, then that&amp;#39;s not very OOP, and probably what adobe had in mind when they decided to implement interfaces - their way of adhering to polymorphism (another buzz word we should all be learning). On the flip-side, just because  we all &amp;quot;accidentally always&amp;quot; used inheritance till we knew better, doesn&amp;#39;t mean there&amp;#39;s not a time and place for it.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3717133688018454834/8979800612886095948/comments/default/2858850668404196771'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3717133688018454834/8979800612886095948/comments/default/2858850668404196771'/><link rel='alternate' type='text/html' href='http://blog.iainlobb.com/2009/05/do-you-extend-or-compose-sprite.html?showComment=1244973944030#c2858850668404196771' title=''/><author><name>Will S</name><uri>http://nucleusd.blogspot.com</uri><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.iainlobb.com/2009/05/do-you-extend-or-compose-sprite.html' ref='tag:blogger.com,1999:blog-3717133688018454834.post-8979800612886095948' source='http://www.blogger.com/feeds/3717133688018454834/posts/default/8979800612886095948' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-3717133688018454834.post-3405914460873826812</id><published>2009-05-20T12:42:00.379+01:00</published><updated>2009-05-20T12:42:00.379+01:00</updated><title type='text'>Since you ask for opinion, here is mine :). I favo...</title><content type='html'>Since you ask for opinion, here is mine :). I favor composition, why ? Because it's cleaner and (for me anyway) it force me to think about how I design my classes and not to hack something up for quick fix. For example, a plane class doesn't need most of the Sprite/Bitmap/MovieClip method and properties on it, they are 'high level' classes, they doesn't supposed to expose those stuff. And the because you are not allowed to access things that is used to be in the Sprite/MC/Bitmap class, you ough to think about what your class are doing with it (Sprite/MC/Bitmap) and it prevent you from doing a hack because you don't have direct access to Sprite/MC/Bitmap anymore :)</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3717133688018454834/8979800612886095948/comments/default/3405914460873826812'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3717133688018454834/8979800612886095948/comments/default/3405914460873826812'/><link rel='alternate' type='text/html' href='http://blog.iainlobb.com/2009/05/do-you-extend-or-compose-sprite.html?showComment=1242819720379#c3405914460873826812' title=''/><author><name>aaulia</name><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.iainlobb.com/2009/05/do-you-extend-or-compose-sprite.html' ref='tag:blogger.com,1999:blog-3717133688018454834.post-8979800612886095948' source='http://www.blogger.com/feeds/3717133688018454834/posts/default/8979800612886095948' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-3717133688018454834.post-1706393739084182328</id><published>2009-05-11T19:13:00.000+01:00</published><updated>2009-05-11T19:13:00.000+01:00</updated><title type='text'>As the OOP mantra goes: "Favour composition over i...</title><content type='html'>As the OOP mantra goes: "Favour composition over inheritance". &lt;br /&gt;&lt;br /&gt;With regards to the display list, when I started doing AS3 I found I was using inheritance far too much. &lt;br /&gt;Over the last year I've found that composition seems to work much better. Why? It's tricky to precisely define, it just seems more logical and cleaner. &lt;br /&gt;Bet that doesn't help at all :)</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3717133688018454834/8979800612886095948/comments/default/1706393739084182328'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3717133688018454834/8979800612886095948/comments/default/1706393739084182328'/><link rel='alternate' type='text/html' href='http://blog.iainlobb.com/2009/05/do-you-extend-or-compose-sprite.html?showComment=1242065580000#c1706393739084182328' title=''/><author><name>yezzer</name><uri>http://www.blogger.com/profile/04675712536498569142</uri><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.iainlobb.com/2009/05/do-you-extend-or-compose-sprite.html' ref='tag:blogger.com,1999:blog-3717133688018454834.post-8979800612886095948' source='http://www.blogger.com/feeds/3717133688018454834/posts/default/8979800612886095948' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-3717133688018454834.post-1798662343364600534</id><published>2009-05-06T22:56:00.000+01:00</published><updated>2009-05-06T22:56:00.000+01:00</updated><title type='text'>I usually extend a Sprite or MovieClip in my class...</title><content type='html'>I usually extend a Sprite or MovieClip in my classes when the instance will be on a display list. If not, I think it's better compose your class with a Sprite.&lt;br /&gt;&lt;br /&gt;However, you have to keep in mind that compose instead of extend use more memory and is one more step when you need to acess some property or method of the Sprite. It's a small step, but it's one more thing to slow down your app.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3717133688018454834/8979800612886095948/comments/default/1798662343364600534'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3717133688018454834/8979800612886095948/comments/default/1798662343364600534'/><link rel='alternate' type='text/html' href='http://blog.iainlobb.com/2009/05/do-you-extend-or-compose-sprite.html?showComment=1241646960000#c1798662343364600534' title=''/><author><name>Andre Anaya</name><uri>http://blog.andreanaya.com</uri><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.iainlobb.com/2009/05/do-you-extend-or-compose-sprite.html' ref='tag:blogger.com,1999:blog-3717133688018454834.post-8979800612886095948' source='http://www.blogger.com/feeds/3717133688018454834/posts/default/8979800612886095948' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-3717133688018454834.post-5029459753779671278</id><published>2009-05-06T16:12:00.000+01:00</published><updated>2009-05-06T16:12:00.000+01:00</updated><title type='text'>Thanks guys, thanks for completely contradictory a...</title><content type='html'>Thanks guys, thanks for completely contradictory answers! What do I do now!? One thing I like about composition of MovieClips is not having a million things on the autocompletion menu. I like the writing less code of extending though. Hmmm.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3717133688018454834/8979800612886095948/comments/default/5029459753779671278'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3717133688018454834/8979800612886095948/comments/default/5029459753779671278'/><link rel='alternate' type='text/html' href='http://blog.iainlobb.com/2009/05/do-you-extend-or-compose-sprite.html?showComment=1241622720000#c5029459753779671278' title=''/><author><name>Iain</name><uri>http://blog.iainlobb.com</uri><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.iainlobb.com/2009/05/do-you-extend-or-compose-sprite.html' ref='tag:blogger.com,1999:blog-3717133688018454834.post-8979800612886095948' source='http://www.blogger.com/feeds/3717133688018454834/posts/default/8979800612886095948' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-3717133688018454834.post-8194729790589946595</id><published>2009-05-06T13:47:00.000+01:00</published><updated>2009-05-06T13:47:00.000+01:00</updated><title type='text'>I think we need to take this outside to the car pa...</title><content type='html'>I think we need to take this outside to the car park mate ;)&lt;br /&gt;&lt;br /&gt;I'm not sure why you'd need a load of getter / setters. Maybe on the controller classes ( Such as a BaddieHandler class that loops through all them bad boys and handles triggering them and houseKeeping ) but when you're in those child classes, the player bullets, the particles, they're kinda self supportive.&lt;br /&gt;For the most part they need an init(), mainloop() and houseKeeping() and that's it.&lt;br /&gt;&lt;br /&gt;It is all kinda moot though, I think it boils down to personal preference.&lt;br /&gt;It's like the first Bond you saw usually ends up being your favourite, even if it was Roger Moore.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3717133688018454834/8979800612886095948/comments/default/8194729790589946595'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3717133688018454834/8979800612886095948/comments/default/8194729790589946595'/><link rel='alternate' type='text/html' href='http://blog.iainlobb.com/2009/05/do-you-extend-or-compose-sprite.html?showComment=1241614020000#c8194729790589946595' title=''/><author><name>Squize</name><uri>http://www.gamingyourway.com</uri><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.iainlobb.com/2009/05/do-you-extend-or-compose-sprite.html' ref='tag:blogger.com,1999:blog-3717133688018454834.post-8979800612886095948' source='http://www.blogger.com/feeds/3717133688018454834/posts/default/8979800612886095948' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-3717133688018454834.post-5238454937645121505</id><published>2009-05-06T07:11:00.000+01:00</published><updated>2009-05-06T07:11:00.000+01:00</updated><title type='text'>I got to go against Squize and Felix on this one.....</title><content type='html'>I got to go against Squize and Felix on this one...  thems fightin words!  ;)&lt;br /&gt;&lt;br /&gt;I use a mix, but a majority of my classes extend Sprite or MovieClip.  MovieClip if its art brought in from an Assets.swf and Flash IDE.   Sprite if I am dynamically creating it.  &lt;br /&gt;&lt;br /&gt;I find it easier to not have to re-invent the wheel by creating getter/setter functions for everything.  If I want to restrict or customize anything specific then I will override that function.&lt;br /&gt;&lt;br /&gt;So basically I combine my controller class with my view in most cases and only use the basic class/object for my data and util classes.     &lt;br /&gt;&lt;br /&gt;Right or wrong... that is what I do.   Thanks for the discussion Iain.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3717133688018454834/8979800612886095948/comments/default/5238454937645121505'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3717133688018454834/8979800612886095948/comments/default/5238454937645121505'/><link rel='alternate' type='text/html' href='http://blog.iainlobb.com/2009/05/do-you-extend-or-compose-sprite.html?showComment=1241590260000#c5238454937645121505' title=''/><author><name>Ickydime</name><uri>http://www.blogger.com/profile/09441385865959854926</uri><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.iainlobb.com/2009/05/do-you-extend-or-compose-sprite.html' ref='tag:blogger.com,1999:blog-3717133688018454834.post-8979800612886095948' source='http://www.blogger.com/feeds/3717133688018454834/posts/default/8979800612886095948' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-3717133688018454834.post-4525694049153278981</id><published>2009-05-05T22:57:00.000+01:00</published><updated>2009-05-05T22:57:00.000+01:00</updated><title type='text'>thanks for your input felix and squize! that's 2 v...</title><content type='html'>thanks for your input felix and squize! that's 2 votes for composition so far. Looks like this one's not going my way ;)&lt;br /&gt;&lt;br /&gt;@felix - need to correct you on that thing about classes extending MovieClip being dynamic - not true, unless you explicitly use the dynamic tag. So actually if you compose a MovieClip you've have more dynamic objects in your code.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3717133688018454834/8979800612886095948/comments/default/4525694049153278981'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3717133688018454834/8979800612886095948/comments/default/4525694049153278981'/><link rel='alternate' type='text/html' href='http://blog.iainlobb.com/2009/05/do-you-extend-or-compose-sprite.html?showComment=1241560620000#c4525694049153278981' title=''/><author><name>Iain</name><uri>http://blog.iainlobb.com</uri><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.iainlobb.com/2009/05/do-you-extend-or-compose-sprite.html' ref='tag:blogger.com,1999:blog-3717133688018454834.post-8979800612886095948' source='http://www.blogger.com/feeds/3717133688018454834/posts/default/8979800612886095948' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-3717133688018454834.post-613829360541893461</id><published>2009-05-05T22:51:00.000+01:00</published><updated>2009-05-05T22:51:00.000+01:00</updated><title type='text'>I always use composition when possible. This way y...</title><content type='html'>I always use composition when possible. This way you can separate the 'business logic' of the class from the MovieClip's properties. Also extending MovieClip means your classes are dynamic which is not usually good.&lt;br /&gt;&lt;br /&gt;On a related note I try not to use the Library Symbol Properties to link a symbol to a class. IMO it's cleaner to keep the linkage ids in the AS file.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3717133688018454834/8979800612886095948/comments/default/613829360541893461'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3717133688018454834/8979800612886095948/comments/default/613829360541893461'/><link rel='alternate' type='text/html' href='http://blog.iainlobb.com/2009/05/do-you-extend-or-compose-sprite.html?showComment=1241560260000#c613829360541893461' title=''/><author><name>felix</name><uri>http://www.airtightinteractive.com</uri><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.iainlobb.com/2009/05/do-you-extend-or-compose-sprite.html' ref='tag:blogger.com,1999:blog-3717133688018454834.post-8979800612886095948' source='http://www.blogger.com/feeds/3717133688018454834/posts/default/8979800612886095948' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-3717133688018454834.post-6960235207499429032</id><published>2009-05-05T22:40:00.000+01:00</published><updated>2009-05-05T22:40:00.000+01:00</updated><title type='text'>I use composition, purely 'cause in my head it fee...</title><content type='html'>I use composition, purely 'cause in my head it feels cluttered extending a sprite / mc, in that my class will inherit a lot of things it won't use.&lt;br /&gt;&lt;br /&gt;Also it feels like I'm more in control that way, that the display object is part of a whole, rather than being the whole/&lt;br /&gt;&lt;br /&gt;Wow, what a great post :S Sorry, tired and the words just aren't coming tonight.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3717133688018454834/8979800612886095948/comments/default/6960235207499429032'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3717133688018454834/8979800612886095948/comments/default/6960235207499429032'/><link rel='alternate' type='text/html' href='http://blog.iainlobb.com/2009/05/do-you-extend-or-compose-sprite.html?showComment=1241559600000#c6960235207499429032' title=''/><author><name>Squize</name><uri>http://www.gamingyourway.com</uri><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.iainlobb.com/2009/05/do-you-extend-or-compose-sprite.html' ref='tag:blogger.com,1999:blog-3717133688018454834.post-8979800612886095948' source='http://www.blogger.com/feeds/3717133688018454834/posts/default/8979800612886095948' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-3717133688018454834.post-6404184117155928083</id><published>2009-05-05T22:29:00.000+01:00</published><updated>2009-05-05T22:29:00.000+01:00</updated><title type='text'>I just came across this - worth a read on the topi...</title><content type='html'>I just came across this - worth a read on the topic...&lt;br /&gt;&lt;br /&gt;http://www.moock.org/blog/archives/000248.html</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3717133688018454834/8979800612886095948/comments/default/6404184117155928083'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3717133688018454834/8979800612886095948/comments/default/6404184117155928083'/><link rel='alternate' type='text/html' href='http://blog.iainlobb.com/2009/05/do-you-extend-or-compose-sprite.html?showComment=1241558940000#c6404184117155928083' title=''/><author><name>Iain</name><uri>http://blog.iainlobb.com</uri><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.iainlobb.com/2009/05/do-you-extend-or-compose-sprite.html' ref='tag:blogger.com,1999:blog-3717133688018454834.post-8979800612886095948' source='http://www.blogger.com/feeds/3717133688018454834/posts/default/8979800612886095948' type='text/html'/></entry></feed>