<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2germanfull.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Ghost23 Blog</title>
	
	<link>http://www.ghost23.de</link>
	<description>A blog about Flash and stuff</description>
	<lastBuildDate>Fri, 11 Jun 2010 10:13:15 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/ghost23/blog" /><feedburner:info uri="ghost23/blog" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><feedburner:emailServiceId>ghost23/blog</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><feedburner:feedFlare href="http://www.bloglines.com/sub/http://feeds.feedburner.com/ghost23/blog" src="http://www.bloglines.com/images/sub_modern11.gif">Subscribe with Bloglines</feedburner:feedFlare><feedburner:feedFlare href="http://www.netvibes.com/subscribe.php?url=http%3A%2F%2Ffeeds.feedburner.com%2Fghost23%2Fblog" src="http://www.netvibes.com/img/add2netvibes.gif">Subscribe with Netvibes</feedburner:feedFlare><feedburner:feedFlare href="http://fusion.google.com/add?feedurl=http%3A%2F%2Ffeeds.feedburner.com%2Fghost23%2Fblog" src="http://buttons.googlesyndication.com/fusion/add.gif">Subscribe with Google</feedburner:feedFlare><feedburner:feedFlare href="http://add.my.yahoo.com/content?lg=de&amp;url=http%3A%2F%2Ffeeds.feedburner.com%2Fghost23%2Fblog" src="http://us.i1.yimg.com/us.yimg.com/i/de/my/addtomyyahoo4.gif">Subscribe with Mein Yahoo!</feedburner:feedFlare><item>
		<title>The “||” operator and a chain of responsibility</title>
		<link>http://feedproxy.google.com/~r/ghost23/blog/~3/rjFd6j8zRYo/</link>
		<comments>http://www.ghost23.de/2010/06/the-operator-and-a-chain-of-responsibility/#comments</comments>
		<pubDate>Sat, 05 Jun 2010 16:45:52 +0000</pubDate>
		<dc:creator>Sven Busse</dc:creator>
				<category><![CDATA[AS3 / Flex]]></category>
		<category><![CDATA[OOP]]></category>
		<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[chain of responsibility]]></category>
		<category><![CDATA[code]]></category>

		<guid isPermaLink="false">http://www.ghost23.de/?p=326</guid>
		<description><![CDATA[Juten Tach, lately i came across the &#124;&#124; operator again and i read through the language specification. Little quiz: What is the content of the variable result in this line of code? var result:* = null &#124;&#124; "one" &#124;&#124; "two"; The answer is: &#8220;one&#8221;. As for me, i had forgotten, that the &#124;&#124; operator actually [...]]]></description>
			<content:encoded><![CDATA[<p>Juten Tach,</p>
<p>lately i came across the || operator again and i read through the language specification. Little quiz: What is the content of the variable <em>result</em> in this line of code?</p>
<pre>var result:* = null || "one" || "two";</pre>
<p>The answer is: &#8220;one&#8221;. As for me, i had forgotten, that the || operator actually returns the value, that evaluates to true. If both values evaluate to true it returns the one on the left first.</p>
<p>So i started to think about, how to make use of this and the Chain of Responsibility Pattern came to my mind. You remember this pattern, right? You have a list of classes, that have different capabilities and you have a task. Instead of finding out by yourself, which class to use, you simply pass it to a chain, where these classes are connected. Each class determines for itself, if it is responsible and the first one, that answers with yes, is returned and gets the job.</p>
<p>So here i present a little exemplary implementation of a Chain of Responsibility, that in its core makes use of the || operator. By the way, i am not really conforming to the original pattern, because i actually don&#8217;t like it. In the original pattern, the potentially responsible classes link to each other directly, which in my opinion causes some trouble. First, they have to be aware, that they are part of a chain, which i think, they shouldn&#8217;t and second, they define the order in the chain themselves, which i think they shouldn&#8217;t and third, the requesting class has to know, which one is the first class in the chain, which i think, it shouldn&#8217;t.</p>
<p><strong>[Caution]</strong>: This post now gets a bit lengthy <img src='http://www.ghost23.de/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>To build this Chain Of Responsibility thing, we need four ingredients: a chain, some potentially responsible classes, a request that should be processed and finally a using class, which wants the request to be processed.</p>
<p>We start with the request. For this example, it is really simple:</p>
<pre>package responsibility {
   public class Request {

      public var stuffToBeProcessed:*;
   }
}</pre>
<p>As you can see, there is just a variable, which holds some kind of value, with which we want to work with. I did not give it a type to make it more interesting at runtime. You will see later on.</p>
<p>OK, next we need some classes, which can handle this type of request. Therefore we define an interface, which describes this general ability.</p>
<pre>package responsibility {
   public interface Responsible {

      /**
       * Checks, if this class can handle the request.
       * @return An instance of Responsible or null.
       */
      function checkResponsibility(request:Request):Responsible;

      /**
       * Processes the request.
       */
      function doIt():void;
   }
}</pre>
<p>Pretty easy, right? The <em>checkResponsibility(request:Request)</em> method will either return itself, if it feels responsible for the request or <em>null</em>. The <em>doIt()</em> method then will actually do, whatever is to be done for fulfilling the request.</p>
<p>Next, we have two concrete classes, which implement this interface, ResponsibleOfStrings and ResponsibleOfNumbers:</p>
<pre>package responsibility {
   public class ResponsibleOfStrings implements Responsible {

      public function checkResponsibility(request:Request):Responsible {
         if(request.stuffToBeProcessed is String) {
            return this;
         }else return null;
      }

      public function doIt():void {
         trace("ResponsibleOfStrings is doing it!");
      }
   }
}

package responsibility {
   public class ResponsibleOfNumbers implements Responsible {

      public function checkResponsibility(request:Request):Responsible {
         if(request.stuffToBeProcessed is Number) {
            return this;
         }else return null;
      }

      public function doIt():void {
         trace("ResponsibleOfNumbers is doing it!");
      }
   }
}</pre>
<p>So, you can see, these classes simply check if the request holds a string or a number respectively. If they find what they expect, they return themselves, otherwise they return <em>null</em>.</p>
<p>OK, next we need a chain. Very well, here it is:</p>
<pre>package responsibility {
   public class ChainOfResponsibility {

      private var listOfResponsibleObjects:Vector. = new Vector.;

      public function addResponsibleObject(responsibleObject:Responsible):void {
         listOfResponsibleObjects.push(responsibleObject);
      }

      public function determineResponsibleObject(request:Request):Responsible {

         var result:Responsible = null;

         for(var i:int = 0; i &lt; listOfResponsibleObjects.length; i++) {
            result ||= listOfResponsibleObjects[i].checkResponsibility(request);
         }

         return result;
      }
   }
}</pre>
<p>So finally here comes the part with the || operator. We run a list of potentially responsible classes. And in the function <em>determineResponsibleObject(request:Request)</em>, we now go through this list. And here we make use of the fact, that when we chain the return values of each <em>checkResponsibility(request)</em> call by using the || operator, we get the first one, that returned itself instead of <em>null</em>. Means, we get the first class instance, which feels responsible for doing the job.</p>
<p>OK, lastly of course, we want to see, how to use that stuff. So here it is:</p>
<pre>package {

   import flash.display.Sprite;
   import responsibility.*;

   public class Main extends Sprite {

      public function Main() {

         var chainOfResponsibility:ChainOfResponsibility = new ChainOfResponsibility;
         chainOfResponsibility.addResponsibleObject(new ResponsibleOfNumbers);
         chainOfResponsibility.addResponsibleObject(new ResponsibleOfStrings);

         var request:Request = new Request;
         request.stuffToBeProcessed = 10;

         var responsibleObject:Responsible = chainOfResponsibility.determineResponsibleObject(request);
         responsibleObject.doIt();
      }
   }
}</pre>
<p>So, first we are setting up our Chain of Responsibility an give it our two responsible classes. Then we build a new request. In this case, we assign a number to the variable <em>stuffToBeProcessed</em>. Then we hand that request over to our chain and save the result in our variable <em>responsibleObject</em>. Finally we call the <em>doIt()</em> method on that object. And if we run this, we get a trace saying &#8220;ResponsibleOfNumbers is doing it!&#8221;, as expected. Of course, if we had assigned a string to the variable <em>stuffToBeProcessed</em>, than we would have seen &#8220;ResponsibleOfStrings is doing it!&#8221;.</p>
<p>Well, that&#8217;s it. If you find this useful, you can use it freely for any purpose.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/ghost23/blog?a=rjFd6j8zRYo:222G44f-k2k:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/ghost23/blog?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ghost23/blog?a=rjFd6j8zRYo:222G44f-k2k:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/ghost23/blog?i=rjFd6j8zRYo:222G44f-k2k:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ghost23/blog?a=rjFd6j8zRYo:222G44f-k2k:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/ghost23/blog?i=rjFd6j8zRYo:222G44f-k2k:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ghost23/blog?a=rjFd6j8zRYo:222G44f-k2k:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/ghost23/blog?d=qj6IDK7rITs" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/ghost23/blog/~4/rjFd6j8zRYo" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.ghost23.de/2010/06/the-operator-and-a-chain-of-responsibility/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.ghost23.de/2010/06/the-operator-and-a-chain-of-responsibility/</feedburner:origLink></item>
		<item>
		<title>UML4AS and Realaxy</title>
		<link>http://feedproxy.google.com/~r/ghost23/blog/~3/jWfZUOLy_LI/</link>
		<comments>http://www.ghost23.de/2010/05/uml4as-and-realaxy/#comments</comments>
		<pubDate>Tue, 25 May 2010 12:09:31 +0000</pubDate>
		<dc:creator>Sven Busse</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.ghost23.de/?p=322</guid>
		<description><![CDATA[Juten Tach, it is a common procedure for me to visit the websites of the people, who leave comments on my blog. And what can i say, this time it payed off very well. On http://actualwave.com/blog/ (caution: this one is in Russian), after some Google Translation, i could find two very interesting links to tools [...]]]></description>
			<content:encoded><![CDATA[<p>Juten Tach,</p>
<p>it is a common procedure for me to visit the websites of the people, who leave comments on my blog. And what can i say, this time it payed off very well. On <a href="http://actualwave.com/blog/" target="_blank">http://actualwave.com/blog/</a> (caution: this one is in Russian), after some Google Translation, i could find two very interesting links to tools for Actionscript:</p>
<ol>
<li><a href="http://www.uml4as.com/" target="_blank">UML4AS</a> is a UML editor plug in for Eclipse, which directly syncs with your ActionScript code and vice versa. Still alpha, but already very promising.</li>
<li><a href="http://realaxy.com/" target="_blank">Realaxy</a> is actually, what i am thinking about for some time now. It is an Actionscript editor based on the <a href="http://www.jetbrains.com/mps/index.html" target="_blank">MPS editor</a> toolkit from Jetbrains, which means, it is based on an abstract syntax tree, instead of code text files. So far, there are only screencasts to watch, but still, very, very interesting.</li>
</ol>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/ghost23/blog?a=jWfZUOLy_LI:iNnA_A6nKfU:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/ghost23/blog?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ghost23/blog?a=jWfZUOLy_LI:iNnA_A6nKfU:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/ghost23/blog?i=jWfZUOLy_LI:iNnA_A6nKfU:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ghost23/blog?a=jWfZUOLy_LI:iNnA_A6nKfU:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/ghost23/blog?i=jWfZUOLy_LI:iNnA_A6nKfU:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ghost23/blog?a=jWfZUOLy_LI:iNnA_A6nKfU:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/ghost23/blog?d=qj6IDK7rITs" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/ghost23/blog/~4/jWfZUOLy_LI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.ghost23.de/2010/05/uml4as-and-realaxy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.ghost23.de/2010/05/uml4as-and-realaxy/</feedburner:origLink></item>
		<item>
		<title>The “in” operator</title>
		<link>http://feedproxy.google.com/~r/ghost23/blog/~3/qVn0Dm3dpAw/</link>
		<comments>http://www.ghost23.de/2010/05/the-in-operator/#comments</comments>
		<pubDate>Mon, 24 May 2010 15:34:26 +0000</pubDate>
		<dc:creator>Sven Busse</dc:creator>
				<category><![CDATA[AS3 / Flex]]></category>
		<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[code]]></category>

		<guid isPermaLink="false">http://www.ghost23.de/?p=315</guid>
		<description><![CDATA[Juten Tach, i work with Actionscript for some time now, but i wasn&#8217;t aware of that little thing. You can use &#8220;in&#8221; for checking, if an attribute/field exists in an object, like so: package { import flash.display.Sprite; public class Test extends Sprite { public function Test() { var myObject:Object = {name: "foo", nothing: "bar"}; trace("name" [...]]]></description>
			<content:encoded><![CDATA[<p>Juten Tach,</p>
<p>i work with Actionscript for some time now, but i wasn&#8217;t aware of that little thing. You can use &#8220;in&#8221; for checking, if an attribute/field exists in an object, like so:</p>
<pre>package {
   import flash.display.Sprite;

   public class Test extends Sprite {

      public function Test() {
         var myObject:Object = {name: "foo", nothing: "bar"};
         trace("name" in myObject);     // true
         trace("anything" in myObject); // false
      }
   }
}</pre>
<p>It also works for checking for fields in class instances. Might come in handy sometime <img src='http://www.ghost23.de/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/ghost23/blog?a=qVn0Dm3dpAw:Gz8TjhHnHQs:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/ghost23/blog?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ghost23/blog?a=qVn0Dm3dpAw:Gz8TjhHnHQs:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/ghost23/blog?i=qVn0Dm3dpAw:Gz8TjhHnHQs:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ghost23/blog?a=qVn0Dm3dpAw:Gz8TjhHnHQs:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/ghost23/blog?i=qVn0Dm3dpAw:Gz8TjhHnHQs:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ghost23/blog?a=qVn0Dm3dpAw:Gz8TjhHnHQs:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/ghost23/blog?d=qj6IDK7rITs" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/ghost23/blog/~4/qVn0Dm3dpAw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.ghost23.de/2010/05/the-in-operator/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://www.ghost23.de/2010/05/the-in-operator/</feedburner:origLink></item>
		<item>
		<title>AS3 – feature request filed – const initialization in constructor</title>
		<link>http://feedproxy.google.com/~r/ghost23/blog/~3/kDIm3ZQRznk/</link>
		<comments>http://www.ghost23.de/2010/05/as3-feature-request-filed-const-initialization-in-constructor/#comments</comments>
		<pubDate>Sat, 15 May 2010 12:26:14 +0000</pubDate>
		<dc:creator>Sven Busse</dc:creator>
				<category><![CDATA[AS3 / Flex]]></category>
		<category><![CDATA[OOP]]></category>
		<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[compiler]]></category>

		<guid isPermaLink="false">http://www.ghost23.de/?p=308</guid>
		<description><![CDATA[Juten Tach, i already wrote about this a while ago, but now i have filed a feature request in the bug base of Adobe. I want const fields allow for being initialized in the constructor, too, not only inline. Here&#8217;s, what i wrote in the ticket: hello, in the AS3 specification it says: &#8220;A variable [...]]]></description>
			<content:encoded><![CDATA[<p>Juten Tach,</p>
<p>i already wrote <a href="http://www.ghost23.de/2009/03/constants/">about this</a> a while ago, but now i have filed a<a href="https://bugs.adobe.com/jira/browse/ASC-4077" target="_blank"> feature request</a> in the bug base of Adobe. I want const fields allow for being initialized in the constructor, too, not only inline. Here&#8217;s, what i wrote in the ticket:</p>
<blockquote><p>hello,</p>
<p>in the <a href="http://livedocs.adobe.com/specs/actionscript/3/as3_specification62.html),">AS3 specification</a> it says:<br />
&#8220;A variable declared with the const rather than the var keyword, is read-only outside of the variable&#8217;s intializer if it is not an instance variable and outside of the instance constructor if it is an instance variable. It is a verifier error to assign to a const variable outside of its writable region.&#8221;</p>
<p>This implies, that a const can be initialized in the constructor, but in fact, it cannot, when in strict mode.</p>
<p>In the past, there have been at least two bug reports around this, with slightly different outcome. An early report (<a title="intializing a const instance variable in the class constructor throws reference error" href="https://bugs.adobe.com/jira/browse/ASC-351"><span style="text-decoration: line-through;">ASC-351</span></a>) seemed to state, that it should be possible to initialize a const in the constructor. Unfortunately, from the report it is unclear, if strict mode was involved or not.</p>
<p>Another report later (<a title="Const initialized in constructor causing compiler error" href="https://bugs.adobe.com/jira/browse/ASC-3562"><span style="text-decoration: line-through;">ASC-3562</span></a>) stated, that it would only be possible without strict mode.</p>
<p>I do think, that const initialization should be possible in the constructor, like the AS3 specification suggests, even in strict mode. It would make the whole const concept more useful. For example, declaring a const in a superclass and giving it a value inline currently means, that in subclasses you cannot give it a different value, because you cannot re-declare the field and you cannot give it a different value in the constructor.</p>
<p>Also, you might want to do some checks to decide which value to assign to the const, which you could do in the constructor based on parameters or other factors.</p>
<p>From my point of view, adding the ability to initialize a const in the constructor in addition to do it inline as currently possible, will not break any existing code, since it just adds new functionality, but does not change or take away existing functionality (besides not throwing a compile time error anymore).</p></blockquote>
<p>So, what do you think? Do you agree? If yes, please <a href="https://bugs.adobe.com/jira/browse/ASC-4077" target="_blank">vote for the feature request</a> in the bug base. Otherwise, i still would be interested to read your opinion, of course <img src='http://www.ghost23.de/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/ghost23/blog?a=kDIm3ZQRznk:TxsegVJAgtI:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/ghost23/blog?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ghost23/blog?a=kDIm3ZQRznk:TxsegVJAgtI:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/ghost23/blog?i=kDIm3ZQRznk:TxsegVJAgtI:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ghost23/blog?a=kDIm3ZQRznk:TxsegVJAgtI:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/ghost23/blog?i=kDIm3ZQRznk:TxsegVJAgtI:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ghost23/blog?a=kDIm3ZQRznk:TxsegVJAgtI:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/ghost23/blog?d=qj6IDK7rITs" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/ghost23/blog/~4/kDIm3ZQRznk" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.ghost23.de/2010/05/as3-feature-request-filed-const-initialization-in-constructor/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://www.ghost23.de/2010/05/as3-feature-request-filed-const-initialization-in-constructor/</feedburner:origLink></item>
		<item>
		<title>Another singleton</title>
		<link>http://feedproxy.google.com/~r/ghost23/blog/~3/cFKoXddoYwg/</link>
		<comments>http://www.ghost23.de/2010/05/another-singleton/#comments</comments>
		<pubDate>Sun, 02 May 2010 08:41:47 +0000</pubDate>
		<dc:creator>Sven Busse</dc:creator>
				<category><![CDATA[AS3 / Flex]]></category>
		<category><![CDATA[Flash in general]]></category>
		<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[singleton]]></category>

		<guid isPermaLink="false">http://www.ghost23.de/?p=304</guid>
		<description><![CDATA[Juten Tach, i know, everybody hates Singletons, and i do, too. But i find it an entertaining exercise to come up with new ways of circumventing the lack of private constructors for Singletons. Today this new one came to my mind: First, we define an Interface, which specifies, how our Singleton should look like: IMySingelton.as: [...]]]></description>
			<content:encoded><![CDATA[<p>Juten Tach,</p>
<p>i know, everybody hates Singletons, and i do, too. But i find it an entertaining exercise to come up with new ways of circumventing the lack of private constructors for Singletons. Today this new one came to my mind:</p>
<p>First, we define an Interface, which specifies, how our Singleton should look like:</p>
<p>IMySingelton.as:</p>
<pre>package {
	public interface IMySingleton {
		function doodle(something:String):void;
	}
}</pre>
<p>Ok, next we define our Singleton.</p>
<p>myInstance.as:</p>
<pre>package {
	public var myInstance:IMySingleton = new MySingleton();
}

class MySingleton implements IMySingleton {
	public function MySingleton() {
		trace("MySingleton is now there!");
	}
	public function doodle(something:String):void {
		trace("yippee: " + something);
	}
}</pre>
<p>Very simple, isn&#8217;t it? We could optionally also go without the Interface, but then we loose code completion in our editors, because the class MySingleton will be ignored by most editors, although it would compile and run just fine. I do agree, that this is not really exactly the idea of a Singleton, because it has no getInstance() method, but in the end, the result is the same, we only have one global instance of MySingleton.</p>
<p>And since the variable is already global, we don&#8217;t even have to declare it in our class, we can directly use it:</p>
<p>Main.as:</p>
<pre>package {
	import flash.display.Sprite;

	public class Main extends Sprite {
		public function Main() {
			myInstance.doodle("loodle");
		}
	}
}</pre>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/ghost23/blog?a=cFKoXddoYwg:8quYEW0tfxM:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/ghost23/blog?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ghost23/blog?a=cFKoXddoYwg:8quYEW0tfxM:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/ghost23/blog?i=cFKoXddoYwg:8quYEW0tfxM:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ghost23/blog?a=cFKoXddoYwg:8quYEW0tfxM:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/ghost23/blog?i=cFKoXddoYwg:8quYEW0tfxM:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ghost23/blog?a=cFKoXddoYwg:8quYEW0tfxM:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/ghost23/blog?d=qj6IDK7rITs" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/ghost23/blog/~4/cFKoXddoYwg" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.ghost23.de/2010/05/another-singleton/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://www.ghost23.de/2010/05/another-singleton/</feedburner:origLink></item>
		<item>
		<title>Flash/iphone chapter closed, let’s move on</title>
		<link>http://feedproxy.google.com/~r/ghost23/blog/~3/63QNpXOg7uo/</link>
		<comments>http://www.ghost23.de/2010/04/flashiphone-chapter-closed-lets-move-on/#comments</comments>
		<pubDate>Wed, 21 Apr 2010 08:45:06 +0000</pubDate>
		<dc:creator>Sven Busse</dc:creator>
				<category><![CDATA[Flash in general]]></category>
		<category><![CDATA[Stuff]]></category>
		<category><![CDATA[androiod]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[flash player]]></category>
		<category><![CDATA[iphone]]></category>

		<guid isPermaLink="false">http://www.ghost23.de/?p=300</guid>
		<description><![CDATA[Juten Tach, now, that this flash / iphone thing is closed, Adobe, can you please make sure, that Flash Player 10.1 on Android will be nothing else but mind-blowing? You know, not like &#8220;it works OK&#8221;, but more like &#8220;wtf, is this flash? you&#8217;re kidding. this is flash? Can&#8217;t believe it, this is sooo fast!&#8221;. [...]]]></description>
			<content:encoded><![CDATA[<p>Juten Tach,</p>
<p>now, that this <a href="http://www.mikechambers.com/blog/2010/04/20/on-adobe-flash-cs5-and-iphone-applications/" target="_blank">flash / iphone thing is closed</a>, Adobe, can you please make sure, that Flash Player 10.1 on Android will be nothing else but mind-blowing? You know, not like &#8220;it works OK&#8221;, but more like &#8220;wtf, is this flash? you&#8217;re kidding. this is flash? Can&#8217;t believe it, this is sooo fast!&#8221;. It doesn&#8217;t matter matter, if it takes another month, but please get this right.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/ghost23/blog?a=63QNpXOg7uo:2WBiPjPCFpI:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/ghost23/blog?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ghost23/blog?a=63QNpXOg7uo:2WBiPjPCFpI:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/ghost23/blog?i=63QNpXOg7uo:2WBiPjPCFpI:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ghost23/blog?a=63QNpXOg7uo:2WBiPjPCFpI:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/ghost23/blog?i=63QNpXOg7uo:2WBiPjPCFpI:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ghost23/blog?a=63QNpXOg7uo:2WBiPjPCFpI:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/ghost23/blog?d=qj6IDK7rITs" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/ghost23/blog/~4/63QNpXOg7uo" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.ghost23.de/2010/04/flashiphone-chapter-closed-lets-move-on/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://www.ghost23.de/2010/04/flashiphone-chapter-closed-lets-move-on/</feedburner:origLink></item>
		<item>
		<title>see-conference #5 – nice (and exhausting)</title>
		<link>http://feedproxy.google.com/~r/ghost23/blog/~3/K9C0Vo9qzSg/</link>
		<comments>http://www.ghost23.de/2010/04/see-conference-5-nice-and-exhausting/#comments</comments>
		<pubDate>Mon, 19 Apr 2010 10:45:53 +0000</pubDate>
		<dc:creator>Sven Busse</dc:creator>
				<category><![CDATA[Stuff]]></category>
		<category><![CDATA[conference]]></category>
		<category><![CDATA[see conference]]></category>
		<category><![CDATA[see#5]]></category>

		<guid isPermaLink="false">http://www.ghost23.de/?p=294</guid>
		<description><![CDATA[Juten Tach, a weekend with a lot of driving lies behind me. The plan was fool-proof, we thought. Take the plane from Hamburg to Frankfurt and go to Wiesbaden by train. Unfortunately, as most of you probably have heard, there were some ash-clouds coming into our way and so on Friday me and David were [...]]]></description>
			<content:encoded><![CDATA[<p>Juten Tach,</p>
<p>a weekend with a lot of driving lies behind me. The plan was fool-proof, we thought. Take the plane from Hamburg to Frankfurt and go to Wiesbaden by train. Unfortunately, as most of you probably have heard, there were some ash-clouds coming into our way and so on Friday me and David were hastily driving to Hamburg airport and canceling our tickets and rent a car. From Hamburg to Wiesbaden it is roughly 520 km. So i got up at 5 in the morning, picked up David and drove to Hanover first, were we picked up <a href="http://blog.jensfranke.com/" target="_blank">Jens</a> and <a href="http://blog.ulfgermann.de" target="_blank">Ulf</a> and then headed for Wiesbaden, where we arrived at 9.45, perfectly on time, but a bit tired, naturally.</p>
<p>The weather in Wiesbaden was awesome, no clouds and after a while we recognized, also no condensation trails of course, because there were no planes flying. I remember, after 9/11, when there was no air traffic over the USA, scientists did a study, where they found, that these <a href="http://edition.cnn.com/2002/TECH/science/08/07/contrails.climate/index.html" target="_blank">condensation trails actually have an effect on climate</a>. I wonder, if scientists were doing studies here in Europe over the weekend, too.</p>
<p>Anyway, the conference began and the first speaker was Prof. H. Franke. I have to say, it wasn&#8217;t the best opening talk, the see conference has seen. Prof. Franke is a true scientist and as such elaborated on facts, that most of the people have probably already heard of. It would have been interesting to me, if he had put these facts in context to when they were found or invented, because then we could have seen, that a lot of what we are working on today has been found out decades ago already, but Prof. Franke did not talk about history, he presented the facts, like if they were brand new.</p>
<p>Because of the air traffic problems, some speakers could not make it to the conference, others had to take adventurous trips through Europe to arrive at Wiesbaden. Thus, the program got mixed up a bit, but that&#8217;s understandable, of course.</p>
<p>The two most interesting talks for me were those from Andrew Vande Moere (<a href="http://infosthetics.com/" target="_blank">infosthetics.com</a>) and from Hannes Koch (<a href="http://www.random-international.com/" target="_blank">www.random-international.com</a>).</p>
<p>Andrew talked about the projects he did and does as a lecturer at universities in Australia and Belgium. The point there was, that Andrew suggests, that data visualization is persuasive, as the designer can choose, how he interprets the data and thus where he puts the emphasis on. Later in the evening, i had the chance to have a chat with him at Mexican restaurant down at at the Rhein, which was nice and insightful.</p>
<p>Hannes Koch presented work from his design studio random. At one point he joked about the people, who always want to know, how the pieces are done technically rather then simply enjoying the pieces. I have to admit, i am one of those nerds, too. I would say, it lies in the nature of us human beings, that we want to understand, how things work, and art installations are no exception. So the only difference might be, some people care less, others care more.</p>
<p>Hannes was the last speaker. In the evening, together with <a href="http://www.nulldesign.de/" target="_blank">Lars</a>, <a href="http://www.rwichmann.com/" target="_blank">Raphael</a>, <a href="http://blog.jensfranke.com/" target="_blank">Jens</a>, <a href="http://www.artificialduck.net/" target="_blank">Patrick</a> and a bunch of other guys we were having a good time chatting, having a beer and enjoying the very nice weather.</p>
<p>Then on Sunday we had to drive back all the way to hamburg, so when i arrived there, the rest of the day was mainly sitting on my balcony and doing nothing really but preparing for my upcoming talk at the <a href="http://www.good-school.de/" target="_blank">GoodSchool</a> next Thursday.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/ghost23/blog?a=K9C0Vo9qzSg:TyMf1eJpzLE:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/ghost23/blog?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ghost23/blog?a=K9C0Vo9qzSg:TyMf1eJpzLE:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/ghost23/blog?i=K9C0Vo9qzSg:TyMf1eJpzLE:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ghost23/blog?a=K9C0Vo9qzSg:TyMf1eJpzLE:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/ghost23/blog?i=K9C0Vo9qzSg:TyMf1eJpzLE:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ghost23/blog?a=K9C0Vo9qzSg:TyMf1eJpzLE:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/ghost23/blog?d=qj6IDK7rITs" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/ghost23/blog/~4/K9C0Vo9qzSg" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.ghost23.de/2010/04/see-conference-5-nice-and-exhausting/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.ghost23.de/2010/04/see-conference-5-nice-and-exhausting/</feedburner:origLink></item>
		<item>
		<title>Adobe CS5 – price difference continues</title>
		<link>http://feedproxy.google.com/~r/ghost23/blog/~3/xtaMaHrHoq0/</link>
		<comments>http://www.ghost23.de/2010/04/adobe-cs5-price-difference-continues/#comments</comments>
		<pubDate>Mon, 12 Apr 2010 09:20:23 +0000</pubDate>
		<dc:creator>Sven Busse</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.ghost23.de/?p=290</guid>
		<description><![CDATA[Juten Tach, what was i thinking? Equal prices for Adobes Creative Suite, no matter, where you live? Nope. Since Adobe has unveiled CS5 and the pre-order forms, the price differences continue. Take the CS5 Web Premium package, for example. price in USA: $ 1,799 price in Germany:  € 1,999 (without VAT) , that&#8217;s around $ [...]]]></description>
			<content:encoded><![CDATA[<p>Juten Tach,</p>
<p>what was i <a href="http://www.ghost23.de/2010/03/adobes-price-differences-across-continents-no-more/">thinking</a>? Equal prices for Adobes Creative Suite, no matter, where you live? Nope. Since Adobe has unveiled CS5 and the pre-order forms, the price differences continue. Take the CS5 Web Premium package, for example.</p>
<p>price in USA: $ 1,799<br />
price in Germany:  € 1,999 (without VAT) , that&#8217;s around $ 2,730 with the current rate.</p>
<p>That means, the german price is roughly 150% of the US price.</p>
<p>On a positive side node, i recognize, that Flash Builder is now part of the Creative Suite, at least in Web Premium, which is good.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/ghost23/blog?a=xtaMaHrHoq0:d4ZPy6ANDt0:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/ghost23/blog?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ghost23/blog?a=xtaMaHrHoq0:d4ZPy6ANDt0:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/ghost23/blog?i=xtaMaHrHoq0:d4ZPy6ANDt0:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ghost23/blog?a=xtaMaHrHoq0:d4ZPy6ANDt0:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/ghost23/blog?i=xtaMaHrHoq0:d4ZPy6ANDt0:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ghost23/blog?a=xtaMaHrHoq0:d4ZPy6ANDt0:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/ghost23/blog?d=qj6IDK7rITs" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/ghost23/blog/~4/xtaMaHrHoq0" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.ghost23.de/2010/04/adobe-cs5-price-difference-continues/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://www.ghost23.de/2010/04/adobe-cs5-price-difference-continues/</feedburner:origLink></item>
		<item>
		<title>abc file format specification – as a diagram</title>
		<link>http://feedproxy.google.com/~r/ghost23/blog/~3/CYZjcmOzHwI/</link>
		<comments>http://www.ghost23.de/2010/04/abc-file-format-specification-as-a-diagram/#comments</comments>
		<pubDate>Mon, 05 Apr 2010 16:17:27 +0000</pubDate>
		<dc:creator>Sven Busse</dc:creator>
				<category><![CDATA[AS3 / Flex]]></category>
		<category><![CDATA[OOP]]></category>
		<category><![CDATA[abc]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[diagram]]></category>

		<guid isPermaLink="false">http://www.ghost23.de/?p=278</guid>
		<description><![CDATA[Juten Tach, after all this thinking about not saving code as text anymore but in an object structure, i thought it might be worthwhile to understand a bit more about how ActionScript is built and what the elements are. What else to do but to dive into the specifications of ActionScript and the AVM2. Specifically i was [...]]]></description>
			<content:encoded><![CDATA[<p>Juten Tach,</p>
<p>after all this thinking about not <a href="http://www.ghost23.de/2010/03/abstract-source-code-representation/">saving code as text anymore</a> but in an object structure, i thought it might be worthwhile to understand a bit more about how ActionScript is built and what the elements are. What else to do but to dive into the specifications of ActionScript and the AVM2. Specifically i was interested in the abc file format, nicely described in the PDF from Adobe: &#8220;<a href="http://www.adobe.com/devnet/actionscript/articles/avm2overview.pdf" target="_blank">ActionScript Virtual Machine 2 (AVM2) Overview</a>&#8220;.</p>
<p>Only problem was, it&#8217;s a lot of text and i usually can understand things better, if i see them visually. So i thought, it might be a good idea to make a diagram out of the textual description. So here it goes. I used Enterprise Architect to draw this, a very nice UML editor, by the way.</p>
<p><a href="http://www.ghost23.de/wp-content/uploads/ABCStructure.pdf"><img class="alignnone size-medium wp-image-279" title="abc file format specification diagram" src="http://www.ghost23.de/wp-content/uploads/abc-file-format_diagram-300x219.gif" alt="The abc file format specification diagram" width="300" height="219" /></a></p>
<p><strong>[Update]:</strong> I changed the format to PDF for better reading and printing.</p>
<p>I admit, there are still quite a lot of lines cutting across each other and making the whole thing still a bit hard to overlook, but hey, it&#8217;s a first version.</p>
<p>Perhaps this might come in handy for you, too, so i am posting this. Should you find mistakes in the diagram, a comment would be appreciated.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/ghost23/blog?a=CYZjcmOzHwI:OY58ngcqr7E:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/ghost23/blog?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ghost23/blog?a=CYZjcmOzHwI:OY58ngcqr7E:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/ghost23/blog?i=CYZjcmOzHwI:OY58ngcqr7E:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ghost23/blog?a=CYZjcmOzHwI:OY58ngcqr7E:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/ghost23/blog?i=CYZjcmOzHwI:OY58ngcqr7E:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ghost23/blog?a=CYZjcmOzHwI:OY58ngcqr7E:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/ghost23/blog?d=qj6IDK7rITs" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/ghost23/blog/~4/CYZjcmOzHwI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.ghost23.de/2010/04/abc-file-format-specification-as-a-diagram/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.ghost23.de/2010/04/abc-file-format-specification-as-a-diagram/</feedburner:origLink></item>
		<item>
		<title>Adobes price differences across continents – no more?</title>
		<link>http://feedproxy.google.com/~r/ghost23/blog/~3/qoZC6eqF8ig/</link>
		<comments>http://www.ghost23.de/2010/03/adobes-price-differences-across-continents-no-more/#comments</comments>
		<pubDate>Sat, 27 Mar 2010 08:41:56 +0000</pubDate>
		<dc:creator>Sven Busse</dc:creator>
				<category><![CDATA[Flash in general]]></category>
		<category><![CDATA[Adobe]]></category>
		<category><![CDATA[flash builder]]></category>
		<category><![CDATA[price]]></category>

		<guid isPermaLink="false">http://www.ghost23.de/?p=275</guid>
		<description><![CDATA[Juten Tach, i just saw the post from Colin Moock, where he was kind enough to post the different links to buy the new Flash Builder 4 in the US, UK, Germany and so on. And what do i see, Germany and the US share almost the same price, actually the german price is even a bit [...]]]></description>
			<content:encoded><![CDATA[<p>Juten Tach,</p>
<p>i just saw the <a href="http://www.moock.org/blog/archives/000300.html" target="_blank">post from Colin Moock</a>, where he was kind enough to post the different links to buy the new Flash Builder 4 in the US, UK, Germany and so on. And what do i see, Germany and the US share almost the same price, actually the german price is even a bit lower. That&#8217;s good. Let&#8217;s see, what happens, when Flash CS5 comes along. Would be cool if we could see a trend there.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/ghost23/blog?a=qoZC6eqF8ig:52cLT0NXkyQ:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/ghost23/blog?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ghost23/blog?a=qoZC6eqF8ig:52cLT0NXkyQ:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/ghost23/blog?i=qoZC6eqF8ig:52cLT0NXkyQ:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ghost23/blog?a=qoZC6eqF8ig:52cLT0NXkyQ:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/ghost23/blog?i=qoZC6eqF8ig:52cLT0NXkyQ:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ghost23/blog?a=qoZC6eqF8ig:52cLT0NXkyQ:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/ghost23/blog?d=qj6IDK7rITs" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/ghost23/blog/~4/qoZC6eqF8ig" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.ghost23.de/2010/03/adobes-price-differences-across-continents-no-more/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.ghost23.de/2010/03/adobes-price-differences-across-continents-no-more/</feedburner:origLink></item>
	</channel>
</rss>
