<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:series="http://unfoldingneurons.com/"
	>

<channel>
	<title>H1DD3N.R350URC3 &#187; OOP</title>
	<atom:link href="http://blog.hexagonstar.com/tag/oop/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.hexagonstar.com</link>
	<description>turn-based glory and pixel pleasure</description>
	<lastBuildDate>Sat, 10 Dec 2011 02:45:06 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>ActionScript: Beaten like a ginger stepchild</title>
		<link>http://blog.hexagonstar.com/actionscript-beaten-like-a-ginger-stepchild/</link>
		<comments>http://blog.hexagonstar.com/actionscript-beaten-like-a-ginger-stepchild/#comments</comments>
		<pubDate>Mon, 10 Aug 2009 06:55:37 +0000</pubDate>
		<dc:creator>sascha</dc:creator>
				<category><![CDATA[Dev]]></category>
		<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[AIR]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[OOP]]></category>

		<guid isPermaLink="false">http://blog.hexagonstar.com/?p=893</guid>
		<description><![CDATA[Recently there has been a lot of uproar about ActionScript from some of the more nominated ActionScript developers. People like Joa Ebert, Nicolas Canasse, Andre Michelle and Peter Elst spoke off their dissatisfaction about the current state of ActionScript, that&#8217;s it&#8217;s stuck in the middle of nowhere, that Adobe isn&#8217;t open enough about their plans [...]]]></description>
			<content:encoded><![CDATA[<p>Recently there has been a lot of uproar about ActionScript from some of the more nominated ActionScript developers. People like <a href="http://blog.joa-ebert.com/2009/08/06/this-is-an-outrage/" target="_blank">Joa Ebert</a>, <a href="http://ncannasse.fr/blog/the_failure_of_as3" target="_blank">Nicolas Canasse</a>, <a href="http://blog.andre-michelle.com/2009/as3-failure/" target="_blank">Andre Michelle</a> and <a href="http://www.peterelst.com/blog/2009/08/09/making-the-case-for-actionscript/" target="_blank">Peter Elst</a> spoke off their dissatisfaction about the current state of ActionScript, that&#8217;s it&#8217;s stuck in the middle of nowhere, that Adobe isn&#8217;t open enough about their plans with the Flash platform, that ActionScript has become too OOP, etc. etc. And though all this bashing hurts, they all got a point about their complaints.</p>
<p><span id="more-893"></span></p>
<p>[ad#ad_content]ActionScript developers are a poor bunch! Internet Applications have become more and more complex and require you to plan your architecture carefully. In fact you need to be not only a programmer but also a full-fledged OOP architect if you want to achieve complex applications or otherwise two weeks later when the client asks for changes you will be in code chaos hell. On the other side the customer can&#8217;t care less and asks you to finish their product within two weeks just like it was in the old days of  Flash 5 where you could churn out some wonders quickly (but dirty under the hood) because, hey, does the client care how well your code is organized? The hell he cares! I feel kind of like: first we all yelled for better code management, now that we have it people start to complain that it&#8217;s too OOP.</p>
<p>Being a game developer who has a few more ambitious projects on the shelf I&#8217;m all for OOP and coding-best-practices. The artsy-fartsy Flash Designer hype from yesteryear had it&#8217;s show but now please move along, it&#8217;s time to advance!  Personally ActionScript was what has taught me OOP practices and I would be nowhere today if it wasn&#8217;t for ActionScript. Sure, I could have probably learned it from C++ or Java too but ActionScript&#8217;s prevalent support and documentation made it a lot easier.</p>
<p>I&#8217;m all for strict typing and seeing some people wishing back dynamic typed features makes my stomach turn over. Instead I&#8217;d rather like to see more data structures that allow strong typing just like the recently introduced Vector does. Really, there&#8217;s no way that 10 horses can pull me back to dynamic typed programming! Sometimes I find AS3 code examples on the web which are all untyped and dynamic, obviously by some coder who completely neglected strong typing because he either didn&#8217;t fully understood it or was too lazy. This is what Nicolas Canasse got right when he stated that ActionScript lacks expressiveness. It leads to people falling back to dynamic typing if they see that all this extra stuff required for the correct approach. I use FDT which has an excellent template system so I don&#8217;t really care if there&#8217;s a tad more code to write to achieve good code. In fact OOP stipulates more code. At first I worried too but I&#8217;ve learned to live with that.</p>
<p>I think Adobe should loosen the grip of ECMA 4 on ActionScript which it already has broken anyway by not being fully compatible to it anymore. haXe is doing many things right where Adobe fails with ActionScript, advanced OOP features like Generics, typed Arrays with auto-casting, in-lining, Enums etc. To stay up to competition ActionScript needs these and then some. Others have already listed their feature hopes which I reflect but here are they once more:</p>
<ul>
<li>Method Overloading (because writing Open-Source frameworks and libraries often is a travesty without this).</li>
<li>Generics</li>
<li>Threading (Oh yes!)</li>
<li>Multi-CPU-Support</li>
<li>Private Constructors (bring them back!)</li>
<li>True Abstract classes/methods</li>
<li>Enums (has been a long time wish. Don&#8217;t know what the problem is!)</li>
<li>Hardware rendering (PV3D etc. are great and all but whats the point if you hit the wall with under 1000 triangles?!)</li>
<li>Compiler performance (Seriously MXMLC needs to hide in the corner if the haXe compiler shows up!)</li>
<li>And last but not least I&#8217;d like to see a lot more love for the AIR runtime like better OS-integration (changing screen resolution for example) and better performance and resource management (the way how AIR wastes up RAM is not from this planet!)</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.hexagonstar.com/actionscript-beaten-like-a-ginger-stepchild/feed/</wfw:commentRss>
		<slash:comments>20</slash:comments>
		</item>
		<item>
		<title>The Confusion about &#039;this&#039;</title>
		<link>http://blog.hexagonstar.com/the-confusion-about-this/</link>
		<comments>http://blog.hexagonstar.com/the-confusion-about-this/#comments</comments>
		<pubDate>Fri, 05 Dec 2008 05:01:39 +0000</pubDate>
		<dc:creator>sascha</dc:creator>
				<category><![CDATA[Dev]]></category>
		<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Coding]]></category>
		<category><![CDATA[OOP]]></category>
		<category><![CDATA[Rant]]></category>

		<guid isPermaLink="false">http://blog.hexagonstar.com/?p=654</guid>
		<description><![CDATA[I often browse through code libraries written by others and can&#8217;t deny noticing that so many developers are making exaggerated use of the &#8216;this&#8217; keyword in their code. Today I came across CASAlib an otherwise very neat and certainly helpful library and after roaming through some of the code base it turns out that in [...]]]></description>
			<content:encoded><![CDATA[<p>I often browse through code libraries written by others and can&#8217;t deny noticing that so many developers are making exaggerated use of the &#8216;this&#8217; keyword in their code. Today I came across <a href="http://casalib.org/" target="_blank">CASAlib</a> an otherwise very neat and certainly helpful library and after roaming through some of the code base it turns out that in most classes they&#8217;ve put &#8216;this&#8217; in front of every single class property.</p>
<p>It seems that many newcomers to ActionScript still don&#8217;t understand the use of &#8216;this&#8217; and that it&#8217;s only really necessary in rare cases, for example if a method parameter has the same name like it&#8217;s relative class property or in a few scope-related situations. It&#8217;s also good to have &#8216;this&#8217; at hand if a dynamic property of a class needs to be accessed (this["foo"]) but other than that please do all a favor and throw out those unnecessary &#8216;this&#8217;! Ban it, lock it in your basement and don&#8217;t let it out unless there&#8217;s really a need for it!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.hexagonstar.com/the-confusion-about-this/feed/</wfw:commentRss>
		<slash:comments>23</slash:comments>
		</item>
		<item>
		<title>Customizing toString()</title>
		<link>http://blog.hexagonstar.com/customizing-tostring/</link>
		<comments>http://blog.hexagonstar.com/customizing-tostring/#comments</comments>
		<pubDate>Sun, 07 Sep 2008 17:15:56 +0000</pubDate>
		<dc:creator>sascha</dc:creator>
				<category><![CDATA[Dev]]></category>
		<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Debugging]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[OOP]]></category>
		<category><![CDATA[Snippets]]></category>
		<category><![CDATA[Source Code]]></category>

		<guid isPermaLink="false">http://blog.hexagonstar.com/?p=640</guid>
		<description><![CDATA[When writing classes for a framework I usually put a custom toString method into important classes so that debugging becomes easier. Normally they would go like something along the lines of: override public function toString():String { return "[ClassName]"; } &#8230; Sometimes adding properties to the returned String that give back information about the class, e.g. [...]]]></description>
			<content:encoded><![CDATA[<p>When writing classes for a framework I usually put a custom toString method into important classes so that debugging becomes easier. Normally they would go like something along the lines of:</p>
<pre lang="actionscript3">override public function toString():String {
	return "[ClassName]";
}</pre>
<p>&#8230; Sometimes adding properties to the returned String that give back information about the class, e.g.</p>
<pre lang="actionscript3">override public function toString():String {
	return "[ImageClass, size=" + _size + "]";
}</pre>
<p>But writing them rigid like that is a disadvantage when you decide later to refactor class names. Admittedly it&#8217;s also not a very elegant way so I got the idea to take the class name that is returned by <em>getQualifiedClassName()</em>. The only problem is that getQualifiedClassName not only provides the type name but also the whole package String of the class. Regular Expressions to the rescue! After twiddling around with them for a while (I&#8217;m by no means a RegExp expert) I got my toString method into the shape that I desired:</p>
<pre lang="actionscript3">override public function toString():String {
	return "[" + getQualifiedClassName(this).match("[^:]*$")[0] + ", size=" + _size + "]";
}</pre>
<p>This way it matches the String returned by getQualifiedClassName with the Regular Expression [^:]*$ which checks from the right end for an arbitrary text up to the first occurring colon, but without including the colon. Taking the first element of the Array returned by match() and you got what you need!</p>
<p>A nice way of using this is when writing abstract classes that contain the toString method and any subclass can use that toString method without the need to override it &#8230; that is of course unless you want ot add other output information.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.hexagonstar.com/customizing-tostring/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Learn some patterns &#8211; Advanced ActionScript 3.0 with Design Patterns</title>
		<link>http://blog.hexagonstar.com/learn-some-patterns-advanced-actionscript-30-with-design-patterns/</link>
		<comments>http://blog.hexagonstar.com/learn-some-patterns-advanced-actionscript-30-with-design-patterns/#comments</comments>
		<pubDate>Thu, 23 Nov 2006 11:16:39 +0000</pubDate>
		<dc:creator>sascha</dc:creator>
				<category><![CDATA[Dev]]></category>
		<category><![CDATA[Random Picks]]></category>
		<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Books]]></category>
		<category><![CDATA[Design Patterns]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[OOP]]></category>

		<guid isPermaLink="false">http://blog.hexagonstar.com/learn-some-patterns-advanced-actionscript-30-with-design-patterns/</guid>
		<description><![CDATA[I&#8217;ve been reading this book by Joey Lott and Danny Patterson since yesterday and thought I&#8217;d loose a couple of words about it &#8230; The book starts with a chapter about application design where it explains how to go through the analysis-, design- , implementation and testing phase. It introduces how to utilize Use Case- [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-229 alignright" style="float: right;" src="http://blog.hexagonstar.com/wp-content/uploads/aas3dpcover.jpg" alt="" width="100" height="123" />I&#8217;ve been reading <a href="http://www.adobepress.com/bookstore/product.asp?isbn=0321477731&amp;rl=1">this book</a> by Joey Lott and Danny Patterson since yesterday and thought I&#8217;d loose a couple of words about it &#8230;<br />
The book starts with a chapter about application design where it explains how to go through the analysis-, design- , implementation and testing phase. It introduces how to utilize Use Case- and Class Diagrams and then gives a lesson on how to use FlexUnit for unit testing. In the second chapter is a good explanation about why and how to use Interfaces (instead of Inheritance) and after that it goes into detail with teaching nine of the more common Design Patterns, namely MVC, Singleton, Factory/Template Method, Proxy, Iterator, Composite, Decorator, Command, Memento and State. In part 3 of the book you&#8217;ll find in-depth information about AS 3.0 features like Events, data IO, E4X and Regular Expressions.</p>
<p><span id="more-117"></span></p>
<p>[ad#ad_content]So how good is this book? If you are familiar with ActionScript 2 or 3 this is a good book which is easy to understand and to follow most time. If you&#8217;re rather new to AS it might be more difficult, not only because of the difficulty to understand OOP but also because many of the code listings in the book have errors. Somebody who is experienced with ActionScript will usually notice the mistakes and correct them while typing but somebody without enough knowledge will probably curse about why the examples per se don&#8217;t run.<br />
Many of the Pattern lessons go into deeper detail than other Pattern books I&#8217;ve read which is a plus! For example in the Command Pattern they not just tell that this Pattern can be used to code Undo/Redo functionality, it also shows how to do so. On the other hand some of the code listing are a bit boring. Who wants to type that dull clock application again for learning the MVC pattern?! I think I saw it before in EAS2.0. But it might be just me waiting for the day where such books are tailored for Game Programmers! <img src='http://blog.hexagonstar.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /><br />
Personally I would have welcome it if the design process stuff had received more attention by being more deep and for example explaining sequence diagrams.<br />
During the code examples some classes are utilized that are part of the book and can be downloaded on the web, or let&#8217;s say they could be downloaded if the book&#8217;s code site were available already.<br />
Apart from these small slips (from which the code incorrectness weights most IMO) I would say this is a decent book that has the ability to teach Patterns where other books were either too advanced or too simple for this topic.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.hexagonstar.com/learn-some-patterns-advanced-actionscript-30-with-design-patterns/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Understanding Interfaces and Polymorphism</title>
		<link>http://blog.hexagonstar.com/understanding-interfaces-and-polymorphism/</link>
		<comments>http://blog.hexagonstar.com/understanding-interfaces-and-polymorphism/#comments</comments>
		<pubDate>Sat, 18 Nov 2006 11:12:58 +0000</pubDate>
		<dc:creator>sascha</dc:creator>
				<category><![CDATA[Dev]]></category>
		<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Books]]></category>
		<category><![CDATA[Coding]]></category>
		<category><![CDATA[Design Patterns]]></category>
		<category><![CDATA[OOP]]></category>

		<guid isPermaLink="false">http://blog.hexagonstar.com/understanding-interfaces-and-polymorphism/</guid>
		<description><![CDATA[I&#8217;ve been using Interfaces a couples of time now when needed but I never fully understood those down-sized Class construct wannabes. I knew they are useful when it is required to have an universal type for different objects but I haven&#8217;t fully grasped to scope why they are so useful otherwise. Also the fact that [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been using Interfaces a couples of time now when needed but I never fully understood those down-sized Class construct wannabes. I knew they are useful when it is required to have an universal type for different objects but I haven&#8217;t fully grasped to scope why they are so useful otherwise. Also the fact that they can&#8217;t contain properties and only public method declarations confused me.</p>
<p><span id="more-112"></span></p>
<p>[ad#ad_content]This has changed instantly today when I read a sample eBook chapter of Joey Lott&#8217;s <strong>Advanced ActionScript 3 with Design Patterns</strong> on <a href="http://labs.adobe.com/technologies/digitaleditions/library/" target="_blank">Adobe Labs new Digital Editions Service</a> , a book that I actually ordered already a couple of days ago (takes a bit to ship to Japan though).</p>
<p>What can I say? This small chapter explains it extremely easy and logically. I&#8217;ve read EAS 2.0 and Head First but this sample chapter made me getting it for the first time really! It also explains about the difference of Abstract Classes and Interfaces, something that has not been mentioned in any other ActionScript book I&#8217;ve read so far.<br />
Full respect to the author! If the rest of the book is of similar quality and clarity I shall be damned if I will not be an OOP Pattern Master in near future!</p>
<p>On a side note, the sample books are being downloaded of what looks like an Apollo app. I&#8217;m not sure how far this is related to Apollo but it works like a standalone eBook reader is downloaded and installed and sample chapters open in it.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.hexagonstar.com/understanding-interfaces-and-polymorphism/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

