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

<channel>
	<title>Dima Berastau &#124; Virtual Nomad</title>
	<atom:link href="http://virtualnomad.net/feed/" rel="self" type="application/rss+xml" />
	<link>http://virtualnomad.net</link>
	<description>50% geek + 50% climber = 100% nomad</description>
	<pubDate>Wed, 28 May 2008 06:49:31 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
	<language>en</language>
			<item>
		<title>Editable charts with Adobe Flex</title>
		<link>http://virtualnomad.net/2008/05/10/editable-charts-with-adobe-flex/</link>
		<comments>http://virtualnomad.net/2008/05/10/editable-charts-with-adobe-flex/#comments</comments>
		<pubDate>Sun, 11 May 2008 02:00:09 +0000</pubDate>
		<dc:creator>Dima Berastau</dc:creator>
		
		<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://virtualnomad.net/2008/05/10/editable-charts-with-adobe-flex/</guid>
		<description><![CDATA[One of the cool things about Flex is its ability to snapshot just about anything in the application. It's usually as simple as:
var snapshot:String =
  ImageSnapshot.encodeImageAsBase64&#40;
    ImageSnapshot.captureImage&#40;&#34;your view component here&#34;, 0,
    new PNGEncoder&#41;&#41;;
This is particularly handy when you've got a dynamically generated resource, such as a chart, that [...]]]></description>
			<content:encoded><![CDATA[<p>One of the cool things about Flex is its ability to snapshot just about anything in the application. It's usually as simple as:</p>
<pre class="actionscript"><span style="color: #000000; font-weight: bold;">var</span> snapshot:<span style="color: #0066CC;">String</span> =
  ImageSnapshot.<span style="color: #006600;">encodeImageAsBase64</span><span style="color: #66cc66;">&#40;</span>
    ImageSnapshot.<span style="color: #006600;">captureImage</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;your view component here&quot;</span>, <span style="color: #cc66cc;">0</span>,
    <span style="color: #000000; font-weight: bold;">new</span> PNGEncoder<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;</pre>
<p>This is particularly handy when you've got a dynamically generated resource, such as a chart, that you'd like to have customized by the user and then exported as an image. One thing that is handy to customize in a chart is its axis titles. That's exactly what we are going to do.</p>
<p><a href="http://www.virtualnomad.net/wp-content/uploads/editablecharts/editablecharts.html">Check out the demo here</a>.</p>
<p>This demo application has view source enabled, so just right click to see how it was put together.</p>
<p>Chart axis titles are typically just strings of text that you specify when you create a chart. However you can use your own TitleRenderer to produce just about anything you want instead of the Flex default. We are going to use the excellent IPE controls by Ely Greenfield available here: <a href="http://demo.quietlyscheming.com/IPE/index.html">http://demo.quietlyscheming.com/IPE/index.html</a></p>
<p>Much of the code in <a href="http://www.virtualnomad.net/wp-content/uploads/editablecharts/srcview/index.html">editablecharts.mxml</a> is standard chart boiler plate, with the exception of horizontal and vertical AxisRenderer properties called <em>titleRenderer</em>. These are set to our custom implementation that hooks up an editable IPE control instead of the default flex TextField.</p>
<p>Following is the code for EditableTitleRenderer:</p>
<pre class="actionscript">package editablecharts <span style="color: #66cc66;">&#123;</span>
  <span style="color: #0066CC;">import</span> mx.<span style="color: #006600;">charts</span>.<span style="color: #006600;">AxisRenderer</span>;
  <span style="color: #0066CC;">import</span> mx.<span style="color: #006600;">core</span>.<span style="color: #006600;">IDataRenderer</span>;
  <span style="color: #0066CC;">import</span> mx.<span style="color: #006600;">core</span>.<span style="color: #006600;">UIComponent</span>;
&nbsp;
  <span style="color: #0066CC;">import</span> qs.<span style="color: #006600;">ipeControls</span>.<span style="color: #006600;">IPETextInput</span>;
&nbsp;
  <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">class</span> EditableTitleRenderer <span style="color: #0066CC;">extends</span> UIComponent
    <span style="color: #0066CC;">implements</span> IDataRenderer <span style="color: #66cc66;">&#123;</span>
    <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> EditableTitleRenderer<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
      <span style="color: #0066CC;">super</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
    <span style="color: #66cc66;">&#125;</span>
&nbsp;
    <span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> editableTitle:IPETextInput;
&nbsp;
    <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #0066CC;">get</span> <span style="color: #0066CC;">data</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">Object</span> <span style="color: #66cc66;">&#123;</span>
      <span style="color: #b1b100;">return</span> editableTitle;
    <span style="color: #66cc66;">&#125;</span>
&nbsp;
    <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #0066CC;">set</span> <span style="color: #0066CC;">data</span><span style="color: #66cc66;">&#40;</span>value:<span style="color: #0066CC;">Object</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
      editableTitle.<span style="color: #0066CC;">text</span> = <span style="color: #0066CC;">String</span><span style="color: #66cc66;">&#40;</span>value<span style="color: #66cc66;">&#41;</span>;
&nbsp;
      invalidateSize<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
      invalidateDisplayList<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
    <span style="color: #66cc66;">&#125;</span>
&nbsp;
    override protected <span style="color: #000000; font-weight: bold;">function</span> createChildren<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
      <span style="color: #0066CC;">super</span>.<span style="color: #006600;">createChildren</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
      editableTitle = <span style="color: #000000; font-weight: bold;">new</span> IPETextInput;
      editableTitle.<span style="color: #006600;">editOnClick</span> = <span style="color: #000000; font-weight: bold;">true</span>;
      editableTitle.<span style="color: #006600;">commitOnEnter</span> = <span style="color: #000000; font-weight: bold;">true</span>;
      editableTitle.<span style="color: #006600;">commitOnBlur</span> = <span style="color: #000000; font-weight: bold;">true</span>;
      editableTitle.<span style="color: #006600;">styleName</span> = <span style="color: #ff0000;">&quot;editableAxisTitle&quot;</span>;
&nbsp;
      addChild<span style="color: #66cc66;">&#40;</span>editableTitle<span style="color: #66cc66;">&#41;</span>;
    <span style="color: #66cc66;">&#125;</span>
&nbsp;
    override protected <span style="color: #000000; font-weight: bold;">function</span> measure<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
      <span style="color: #000000; font-weight: bold;">var</span> oldRotation:<span style="color: #0066CC;">Number</span> = rotation;
&nbsp;
      <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>parent &amp;amp;&amp;amp; parent.<span style="color: #006600;">rotation</span> == <span style="color: #cc66cc;">90</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
        rotation = <span style="color: #cc66cc;">-90</span>;
      <span style="color: #66cc66;">&#125;</span>
      editableTitle.<span style="color: #006600;">validateNow</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
      measuredWidth = editableTitle.<span style="color: #006600;">measuredWidth</span>;
      measuredHeight = editableTitle.<span style="color: #006600;">measuredHeight</span>;
&nbsp;
      rotation = oldRotation;
    <span style="color: #66cc66;">&#125;</span> 
&nbsp;
    override protected <span style="color: #000000; font-weight: bold;">function</span> updateDisplayList<span style="color: #66cc66;">&#40;</span>unscaledWidth:<span style="color: #0066CC;">Number</span>,
      unscaledHeight:<span style="color: #0066CC;">Number</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
      <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>parent &amp;amp;&amp;amp; parent is AxisRenderer
        &amp;amp;&amp;amp; parent.<span style="color: #006600;">rotation</span> == <span style="color: #cc66cc;">90</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
        <span style="color: #000000; font-weight: bold;">var</span> p:AxisRenderer = AxisRenderer<span style="color: #66cc66;">&#40;</span>parent<span style="color: #66cc66;">&#41;</span>;
        <span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span>p.<span style="color: #0066CC;">getStyle</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'verticalAxisTitleAlignment'</span><span style="color: #66cc66;">&#41;</span> == <span style="color: #ff0000;">'vertical'</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
          editableTitle.<span style="color: #006600;">rotation</span> = <span style="color: #cc66cc;">180</span>;
          editableTitle.<span style="color: #006600;">y</span> = editableTitle.<span style="color: #006600;">y</span> + editableTitle.<span style="color: #0066CC;">height</span>;
          editableTitle.<span style="color: #006600;">x</span> = editableTitle.<span style="color: #006600;">x</span> + editableTitle.<span style="color: #0066CC;">width</span>;
        <span style="color: #66cc66;">&#125;</span>
      <span style="color: #66cc66;">&#125;</span>
      editableTitle.<span style="color: #006600;">validateNow</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
      editableTitle.<span style="color: #006600;">setActualSize</span><span style="color: #66cc66;">&#40;</span>unscaledWidth, unscaledHeight<span style="color: #66cc66;">&#41;</span>;
    <span style="color: #66cc66;">&#125;</span>
  <span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span></pre>
<p>One thing to keep in mind is that <strong>you need embedded fonts to pull off rotation</strong>. If you sent rotation to anything other than 0 on a normal TextField control it'll just disappear. To work around that use an embedded font.</p>
<p>That's pretty much all there's to editable chart axis titles in Flex.</p>
]]></content:encoded>
			<wfw:commentRss>http://virtualnomad.net/2008/05/10/editable-charts-with-adobe-flex/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Aspect-Oriented Programming in ActionScript3</title>
		<link>http://virtualnomad.net/2007/11/17/aspect-oriented-programming-in-actionscript3/</link>
		<comments>http://virtualnomad.net/2007/11/17/aspect-oriented-programming-in-actionscript3/#comments</comments>
		<pubDate>Sat, 17 Nov 2007 22:26:07 +0000</pubDate>
		<dc:creator>Dima Berastau</dc:creator>
		
		<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://virtualnomad.net/2007/11/17/aspect-oriented-programming-in-actionscript3/</guid>
		<description><![CDATA[Summary
AOP techniques are possible in ActionScript3 (AS3) but it sure ain't pretty. In fact, it's virtually unusable.
Motivation
Before Flex came along online ads, movies and fairly small animation-driven websites were the primary consumers of the Flash platform. Now that you've got reusable components and an extensible event framework people are writing some pretty big and complex [...]]]></description>
			<content:encoded><![CDATA[<h5>Summary</h5>
<p>AOP techniques <i>are</i> possible in ActionScript3 (AS3) but it sure ain't pretty. In fact, it's virtually unusable.</p>
<h5>Motivation</h5>
<p>Before Flex came along online ads, movies and fairly small animation-driven websites were the primary consumers of the Flash platform. Now that you've got reusable components and an extensible event framework people are writing some pretty big and complex Object-Oriented (OO) applications in Flex/AS3 for the Flash platform.</p>
<p>Sooner or later most complex OO systems begin to suffer from some degree of code tangling and scattering. Good design can help delay the symptoms but it cannot solve the fundamental problem. No amount of re-factoring or juggling design patterns can overcome the fact that primary OO modularity techniques (e.g. Abstract Data Types + Inheritance) just cannot modularize certain class of problems in a clean way. Things like transactions, caching, logging, security and so on cut across the inheritance boundaries and hence cannot be captured with classes and methods alone. <a href="http://en.wikipedia.org/wiki/Aspect-oriented_programming">Aspect-Oriented Programming</a> (AOP) offers some very handy and practical solutions to the problem. </p>
<p>It's been battle proven in a host of other languages so why not AS3? The fact of the matter is that eventually the same problems encountered in Java/C/C++/C# applications will re-appear or already have re-appeared in Flex/AS3 apps. The only logical conclusion that doesn't involve re-inventing the wheel is that you'll need a similar set of tools to solve these problems.</p>
<h5>Solution</h5>
<p>There's a couple of different ways AOP can be implemented in a language like AS3. The most accessible way in AS3 at this point of time is using <a href="http://livedocs.adobe.com/labs/flex/3/langref/flash/utils/Proxy.html">proxies</a>.</p>
<p>You can create proxies in AS3 easily enough, e.g.:</p>
<pre class="actionscript">&nbsp;
package test <span style="color: #66cc66;">&#123;</span>
       <span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">utils</span>.<span style="color: #006600;">*</span>;
&nbsp;
       use namespace flash_proxy;
&nbsp;
       <span style="color: #0066CC;">public</span> <span style="color: #0066CC;">dynamic</span> <span style="color: #000000; font-weight: bold;">class</span> TestProxy <span style="color: #0066CC;">extends</span> Proxy <span style="color: #66cc66;">&#123;</span>
               protected <span style="color: #000000; font-weight: bold;">var</span> <span style="color: #0066CC;">target</span>:*;
&nbsp;
               <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> TestProxy<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">target</span>:*<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
                       <span style="color: #0066CC;">super</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
                       <span style="color: #0066CC;">this</span>.<span style="color: #0066CC;">target</span> = <span style="color: #0066CC;">target</span>;
               <span style="color: #66cc66;">&#125;</span>
&nbsp;
               flash_proxy override <span style="color: #000000; font-weight: bold;">function</span> callProperty<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">name</span>:*, ...<span style="color: #006600;">args</span><span style="color: #66cc66;">&#41;</span>:* <span style="color: #66cc66;">&#123;</span>
                       <span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;call property: &quot;</span> + <span style="color: #0066CC;">name</span> + args<span style="color: #66cc66;">&#41;</span>;
                       <span style="color: #b1b100;">return</span> <span style="color: #0066CC;">target</span><span style="color: #66cc66;">&#91;</span><span style="color: #0066CC;">name</span><span style="color: #66cc66;">&#93;</span>.<span style="color: #0066CC;">apply</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">target</span>, args<span style="color: #66cc66;">&#41;</span>;
               <span style="color: #66cc66;">&#125;</span>
&nbsp;
               flash_proxy override <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #0066CC;">getProperty</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">name</span>:*<span style="color: #66cc66;">&#41;</span>:* <span style="color: #66cc66;">&#123;</span>
                       <span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;get property: &quot;</span> + <span style="color: #0066CC;">name</span><span style="color: #66cc66;">&#41;</span>;
                       <span style="color: #b1b100;">return</span> <span style="color: #0066CC;">target</span><span style="color: #66cc66;">&#91;</span><span style="color: #0066CC;">name</span><span style="color: #66cc66;">&#93;</span>;
               <span style="color: #66cc66;">&#125;</span>
&nbsp;
               flash_proxy override <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #0066CC;">setProperty</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">name</span>:*, value:*<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
                       <span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;set property: &quot;</span> + <span style="color: #0066CC;">name</span> + <span style="color: #ff0000;">&quot;:&quot;</span> + value<span style="color: #66cc66;">&#41;</span>;
                       <span style="color: #0066CC;">target</span><span style="color: #66cc66;">&#91;</span><span style="color: #0066CC;">name</span><span style="color: #66cc66;">&#93;</span> = value;
               <span style="color: #66cc66;">&#125;</span>
&nbsp;
               flash_proxy override <span style="color: #000000; font-weight: bold;">function</span> hasProperty<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">name</span>:*<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">Boolean</span> <span style="color: #66cc66;">&#123;</span>
                       <span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;has property: &quot;</span> + <span style="color: #0066CC;">name</span><span style="color: #66cc66;">&#41;</span>;
                       <span style="color: #b1b100;">return</span> <span style="color: #0066CC;">target</span>.<span style="color: #006600;">hasOwnProperty</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">name</span><span style="color: #66cc66;">&#41;</span>;
               <span style="color: #66cc66;">&#125;</span>
&nbsp;
               flash_proxy override <span style="color: #000000; font-weight: bold;">function</span> isAttribute<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">name</span>:*<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">Boolean</span> <span style="color: #66cc66;">&#123;</span>
                       <span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;is attribute: &quot;</span> + <span style="color: #0066CC;">name</span><span style="color: #66cc66;">&#41;</span>;
                       <span style="color: #b1b100;">return</span> !<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">target</span><span style="color: #66cc66;">&#91;</span><span style="color: #0066CC;">name</span><span style="color: #66cc66;">&#93;</span> is <span style="color: #000000; font-weight: bold;">Function</span><span style="color: #66cc66;">&#41;</span>;
               <span style="color: #66cc66;">&#125;</span>
       <span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span>
&nbsp;</pre>
<p>This'll wrap property, method invocations on a target object which you<br />
can use along these lines:</p>
<pre class="actionscript">&nbsp;
<span style="color: #808080; font-style: italic;">// original object used directly</span>
<span style="color: #000000; font-weight: bold;">var</span> foo:Foo = <span style="color: #000000; font-weight: bold;">new</span> Foo;
<span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span>foo.<span style="color: #006600;">bar</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #808080; font-style: italic;">// now proxy the object</span>
<span style="color: #000000; font-weight: bold;">var</span> testProxy:TestProxy = <span style="color: #000000; font-weight: bold;">new</span> TestProxy<span style="color: #66cc66;">&#40;</span>foo<span style="color: #66cc66;">&#41;</span>;
<span style="color: #808080; font-style: italic;">// this will print the proxy trace statement first and then invoke bar</span>
<span style="color: #808080; font-style: italic;">// on the target object</span>
<span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span>testProxy.<span style="color: #006600;">bar</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;</pre>
<p>So far so good, this can totally be a foundation for a fully functional AOP framework in AS3. Couple this will custom annotations a-la [Bindable] and you can start churning out code for [Loggable], [Transactionable], etc. All you need to do is parse the annotations off classes at runtime and substitute those classes with proxies. </p>
<p>But there's a big fat problem with the way you create and use proxies in AS3. You have to extend flash.utils.Proxy class which subclasses Object class directly (the root of AS3 inheritance hierarchy). As far as the compiler and AVM are concerned your new proxy is a subclass of flash.utils.Proxy full stop. There's no way to dynamically extend classes or implement interfaces in AS3 at runtime (that I am aware of). So unless you are planning on creating custom proxies for each class you intend to proxy or abandon the type system entirely and change all method signatures to deal with Objects these proxies are pretty much useless.</p>
<p>Here's what you <i>should</i> be able to say in code but you can't given the way proxies work in AS3 right now:</p>
<pre class="actionscript">&nbsp;
<span style="color: #000000; font-weight: bold;">var</span> testProxy:Foo = <span style="color: #000000; font-weight: bold;">new</span> TestProxy<span style="color: #66cc66;">&#40;</span>foo<span style="color: #66cc66;">&#41;</span> as Foo;
<span style="color: #808080; font-style: italic;">// testProxy is now null because we can't convert TestProxy to type Foo</span>
&nbsp;</pre>
<p>The point is that you can't use AS3 proxies instead of the original objects if the exact type of the object is expected. For example, you can't wrap around a Button and add it to the view root because addChild method expects a DisplayObject. I doubt anybody will want anything to do with AOP in AS3 if it means abandoning the type system, which is one of its strongest points.</p>
<p>This is quite unfortunate because there are some attempts in the wild to bring more AOP into AS3 world (e.g. the <a href="http://code.google.com/p/advancedflex/">Advanced Flex</a> project. They've even implemented some of the AOP semantic concepts such as Advices and Pointcuts. However the entire thing is based on proxies and you can't really use them for AOP right now.</p>
<p>To put things in perspective there are Java-land frameworks that quite successfully implement AOP using dynamic Java proxies. That's because you can make Java proxies implement arbitrary interfaces <i>on-demand</i> at runtime. </p>
<h5>What are the other options?</h5>
<p>I am aware of two other possibilities for AOP implementation:</p>
<ul>
<li><b>Dynamic Subclassing (a-la CGLIB in Java).</b> This is a no go area in AS3 because you can't dynamically subclass classes at runtime (not that I am aware of).</li>
<li><b>Byte-code weaving.</b> This is the "real" man's (read non-trivial) solution and would end up doing what AspectJ does for Java. You'd need to parse SWF files/ABC bytecode and weave it straight after AS3 compilation phase. This also implies writing some kind of a domain specific language to do that (pretty much porting AspectJ syntax to AS3). Quite a lot of work any way you look at it.</li>
</ul>
<p>As it stands proxies is the easiest way to go, let's hope Adobe cooks up some way of dynamically extending classes/interfaces at run-time using proxies. If that happens we are back in the AOP game, until then hold your horses and keep scattering your code <img src='http://virtualnomad.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p>
]]></content:encoded>
			<wfw:commentRss>http://virtualnomad.net/2007/11/17/aspect-oriented-programming-in-actionscript3/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Back Blogging</title>
		<link>http://virtualnomad.net/2007/11/13/back-blogging/</link>
		<comments>http://virtualnomad.net/2007/11/13/back-blogging/#comments</comments>
		<pubDate>Wed, 14 Nov 2007 06:56:29 +0000</pubDate>
		<dc:creator>Dima Berastau</dc:creator>
		
		<category><![CDATA[Random]]></category>

		<guid isPermaLink="false">http://virtualnomad.net/2007/11/13/back-blogging/</guid>
		<description><![CDATA[I decided to pick up the virtual pen again and start throwing some ideas/experiments I've accumulated recently out there. Hopefully somebody else will find this stuff useful.
This is going to be primarily a software development blog focused on web/RIA apps.
]]></description>
			<content:encoded><![CDATA[<p>I decided to pick up the virtual pen again and start throwing some ideas/experiments I've accumulated recently out there. Hopefully somebody else will find this stuff useful.</p>
<p>This is going to be primarily a software development blog focused on web/RIA apps.</p>
]]></content:encoded>
			<wfw:commentRss>http://virtualnomad.net/2007/11/13/back-blogging/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
