<?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 in the Hour of Chaos</description>
	<lastBuildDate>Wed, 01 Sep 2010 12:29:46 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=abc</generator>
<image>
    <title>H1DD3N.R350URC3</title>
    <url>http://blog.hexagonstar.com/feed-logo.png</url>
    <link>http://blog.hexagonstar.com</link>
    <width>144</width>
    <height>36</height>
    <description>H1DD3N.R350URC3 - http://blog.hexagonstar.com</description>
    </image>		<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>>> <a href="http://blog.hexagonstar.com/actionscript-beaten-like-a-ginger-stepchild/">Continue reading "ActionScript: Beaten like a ginger stepchild"</a></p>
<br /><small>© 2009 <a href="http://blog.hexagonstar.com">H1DD3N.R350URC3</a>. | <a href="http://blog.hexagonstar.com/actionscript-beaten-like-a-ginger-stepchild/">Permalink</a> | <a href="http://blog.hexagonstar.com/actionscript-beaten-like-a-ginger-stepchild/#comments">20 comments</a> | Tags: <a href="http://blog.hexagonstar.com/tag/actionscript/" rel="tag">ActionScript</a>, <a href="http://blog.hexagonstar.com/tag/air/" rel="tag">AIR</a>, <a href="http://blog.hexagonstar.com/tag/flash/" rel="tag">Flash</a>, <a href="http://blog.hexagonstar.com/tag/oop/" rel="tag">OOP</a> | Add to <a href="http://del.icio.us/post?url=http://blog.hexagonstar.com/actionscript-beaten-like-a-ginger-stepchild/&title=ActionScript: Beaten like a ginger stepchild">del.icio.us</a></small>]]></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 &#8216;this&#8217;</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>
<img src="http://blog.hexagonstar.com/?ak_action=api_record_view&id=654&type=feed" alt="" /><br /><small>© 2008 <a href="http://blog.hexagonstar.com">H1DD3N.R350URC3</a>. | <a href="http://blog.hexagonstar.com/the-confusion-about-this/">Permalink</a> | <a href="http://blog.hexagonstar.com/the-confusion-about-this/#comments">23 comments</a> | Tags: <a href="http://blog.hexagonstar.com/tag/actionscript/" rel="tag">ActionScript</a>, <a href="http://blog.hexagonstar.com/tag/coding/" rel="tag">Coding</a>, <a href="http://blog.hexagonstar.com/tag/oop/" rel="tag">OOP</a>, <a href="http://blog.hexagonstar.com/tag/rant/" rel="tag">Rant</a> | Add to <a href="http://del.icio.us/post?url=http://blog.hexagonstar.com/the-confusion-about-this/&title=The Confusion about &#8216;this&#8217;">del.icio.us</a></small>]]></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&#40;&#41;:String &#123; return &#34;[ClassName]&#34;; &#125; &#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>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;">override <span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> <span style="color: #004993;">toString</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">String</span> <span style="color: #000000;">&#123;</span>
	<span style="color: #0033ff; font-weight: bold;">return</span> <span style="color: #990000;">&quot;[ClassName]&quot;</span>;
<span style="color: #000000;">&#125;</span></pre></div></div>

<p>&#8230; Sometimes adding properties to the returned String that give back information about the class, e.g.</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;">override <span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> <span style="color: #004993;">toString</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">String</span> <span style="color: #000000;">&#123;</span>
	<span style="color: #0033ff; font-weight: bold;">return</span> <span style="color: #990000;">&quot;[ImageClass, size=&quot;</span> <span style="color: #000000; font-weight: bold;">+</span> _size <span style="color: #000000; font-weight: bold;">+</span> <span style="color: #990000;">&quot;]&quot;</span>;
<span style="color: #000000;">&#125;</span></pre></div></div>

<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>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;">override <span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> <span style="color: #004993;">toString</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">String</span> <span style="color: #000000;">&#123;</span>
	<span style="color: #0033ff; font-weight: bold;">return</span> <span style="color: #990000;">&quot;[&quot;</span> <span style="color: #000000; font-weight: bold;">+</span> <span style="color: #004993;">getQualifiedClassName</span><span style="color: #000000;">&#40;</span><span style="color: #0033ff; font-weight: bold;">this</span><span style="color: #000000;">&#41;</span>.<span style="color: #004993;">match</span><span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;[^:]*$&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#91;</span><span style="color: #000000; font-weight:bold;">0</span><span style="color: #000000;">&#93;</span> <span style="color: #000000; font-weight: bold;">+</span> <span style="color: #990000;">&quot;, size=&quot;</span> <span style="color: #000000; font-weight: bold;">+</span> _size <span style="color: #000000; font-weight: bold;">+</span> <span style="color: #990000;">&quot;]&quot;</span>;
<span style="color: #000000;">&#125;</span></pre></div></div>

<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>
<img src="http://blog.hexagonstar.com/?ak_action=api_record_view&id=640&type=feed" alt="" /><br /><small>© 2008 <a href="http://blog.hexagonstar.com">H1DD3N.R350URC3</a>. | <a href="http://blog.hexagonstar.com/customizing-tostring/">Permalink</a> | <a href="http://blog.hexagonstar.com/customizing-tostring/#comments">11 comments</a> | Tags: <a href="http://blog.hexagonstar.com/tag/actionscript/" rel="tag">ActionScript</a>, <a href="http://blog.hexagonstar.com/tag/debugging/" rel="tag">Debugging</a>, <a href="http://blog.hexagonstar.com/tag/flash/" rel="tag">Flash</a>, <a href="http://blog.hexagonstar.com/tag/flex/" rel="tag">Flex</a>, <a href="http://blog.hexagonstar.com/tag/oop/" rel="tag">OOP</a>, <a href="http://blog.hexagonstar.com/tag/snippets/" rel="tag">Snippets</a>, <a href="http://blog.hexagonstar.com/tag/source-code/" rel="tag">Source Code</a> | Add to <a href="http://del.icio.us/post?url=http://blog.hexagonstar.com/customizing-tostring/&title=Customizing toString()">del.icio.us</a></small>]]></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>>> <a href="http://blog.hexagonstar.com/learn-some-patterns-advanced-actionscript-30-with-design-patterns/">Continue reading "Learn some patterns &#8211; Advanced ActionScript 3.0 with Design Patterns"</a></p>
<br /><small>© 2006 <a href="http://blog.hexagonstar.com">H1DD3N.R350URC3</a>. | <a href="http://blog.hexagonstar.com/learn-some-patterns-advanced-actionscript-30-with-design-patterns/">Permalink</a> | <a href="http://blog.hexagonstar.com/learn-some-patterns-advanced-actionscript-30-with-design-patterns/#comments">2 comments</a> | Tags: <a href="http://blog.hexagonstar.com/tag/actionscript/" rel="tag">ActionScript</a>, <a href="http://blog.hexagonstar.com/tag/books/" rel="tag">Books</a>, <a href="http://blog.hexagonstar.com/tag/design-patterns/" rel="tag">Design Patterns</a>, <a href="http://blog.hexagonstar.com/tag/flash/" rel="tag">Flash</a>, <a href="http://blog.hexagonstar.com/tag/oop/" rel="tag">OOP</a> | Add to <a href="http://del.icio.us/post?url=http://blog.hexagonstar.com/learn-some-patterns-advanced-actionscript-30-with-design-patterns/&title=Learn some patterns &#8211; Advanced ActionScript 3.0 with Design Patterns">del.icio.us</a></small>]]></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>>> <a href="http://blog.hexagonstar.com/understanding-interfaces-and-polymorphism/">Continue reading "Understanding Interfaces and Polymorphism"</a></p>
<br /><small>© 2006 <a href="http://blog.hexagonstar.com">H1DD3N.R350URC3</a>. | <a href="http://blog.hexagonstar.com/understanding-interfaces-and-polymorphism/">Permalink</a> | <a href="http://blog.hexagonstar.com/understanding-interfaces-and-polymorphism/#comments">2 comments</a> | Tags: <a href="http://blog.hexagonstar.com/tag/actionscript/" rel="tag">ActionScript</a>, <a href="http://blog.hexagonstar.com/tag/books/" rel="tag">Books</a>, <a href="http://blog.hexagonstar.com/tag/coding/" rel="tag">Coding</a>, <a href="http://blog.hexagonstar.com/tag/design-patterns/" rel="tag">Design Patterns</a>, <a href="http://blog.hexagonstar.com/tag/oop/" rel="tag">OOP</a> | Add to <a href="http://del.icio.us/post?url=http://blog.hexagonstar.com/understanding-interfaces-and-polymorphism/&title=Understanding Interfaces and Polymorphism">del.icio.us</a></small>]]></content:encoded>
			<wfw:commentRss>http://blog.hexagonstar.com/understanding-interfaces-and-polymorphism/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
