<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: Aspect-Oriented Programming in ActionScript3</title>
	<atom:link href="http://virtualnomad.net/2007/11/17/aspect-oriented-programming-in-actionscript3/feed/" rel="self" type="application/rss+xml" />
	<link>http://virtualnomad.net/2007/11/17/aspect-oriented-programming-in-actionscript3/</link>
	<description>50% geek + 50% climber = 100% nomad</description>
	<pubDate>Thu, 04 Dec 2008 03:26:52 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
		<item>
		<title>By: daniel</title>
		<link>http://virtualnomad.net/2007/11/17/aspect-oriented-programming-in-actionscript3/#comment-7</link>
		<dc:creator>daniel</dc:creator>
		<pubDate>Fri, 25 Apr 2008 13:33:16 +0000</pubDate>
		<guid isPermaLink="false">http://virtualnomad.net/2007/11/17/aspect-oriented-programming-in-actionscript3/#comment-7</guid>
		<description>While implementing the decorator pattern for a unique application, I ran into some of the same issues you mention in your article. I'm only beginning to understand the applications of AOP. Would you say my implementation description below is related to AOP?

-------------- 

My decorator implementation has two requirements that distinguish it from the classic pattern:
1) Decorators add new behavior to the class it wraps (while also modifying existing behavior)
2) New behavior must be accessible
2) A decorated object can be undecorated

This led to some interesting challenges such as,
A) Once an object is decorated several times, how to check if the objects implements an interface implemented by a decorator. (I found no way to modify an object's type at runtime)
B) How to un-decorate an object that is decorated

I solved these challenges by adding a undecorate, retrieveDecorator, and static decorate functions to each decorated/decorator object. 

In this way I can dynamically decorate/undecorate an object and therefore dynamically add and remove behavior to an object. I can also access added dynamic behavior by calling retrieveDecorator, assigning its return value to a local variable and invoking

An example of using this is:

var decorated:DecoratedObject = new ConcreteDecoratedObject();
decorated = DecA.decorate( decorated ); //adds IDecA behavior
decorated = DecB.decorate( decorated ); //adds IDecB behavior

trace( decorated is IDecA ); // RETURNS FALSE
trace( decorated is IDecB ); // RETURNS TRUE

// to access IDecA behavior, I must do this
var decA:IDecA = decorated.retreiveDecorator( IDecA ) as IDecA;
if( decA != null )
{
   // access decA behavior here
}</description>
		<content:encoded><![CDATA[<p>While implementing the decorator pattern for a unique application, I ran into some of the same issues you mention in your article. I&#8217;m only beginning to understand the applications of AOP. Would you say my implementation description below is related to AOP?</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8211; </p>
<p>My decorator implementation has two requirements that distinguish it from the classic pattern:<br />
1) Decorators add new behavior to the class it wraps (while also modifying existing behavior)<br />
2) New behavior must be accessible<br />
2) A decorated object can be undecorated</p>
<p>This led to some interesting challenges such as,<br />
A) Once an object is decorated several times, how to check if the objects implements an interface implemented by a decorator. (I found no way to modify an object&#8217;s type at runtime)<br />
B) How to un-decorate an object that is decorated</p>
<p>I solved these challenges by adding a undecorate, retrieveDecorator, and static decorate functions to each decorated/decorator object. </p>
<p>In this way I can dynamically decorate/undecorate an object and therefore dynamically add and remove behavior to an object. I can also access added dynamic behavior by calling retrieveDecorator, assigning its return value to a local variable and invoking</p>
<p>An example of using this is:</p>
<p>var decorated:DecoratedObject = new ConcreteDecoratedObject();<br />
decorated = DecA.decorate( decorated ); //adds IDecA behavior<br />
decorated = DecB.decorate( decorated ); //adds IDecB behavior</p>
<p>trace( decorated is IDecA ); // RETURNS FALSE<br />
trace( decorated is IDecB ); // RETURNS TRUE</p>
<p>// to access IDecA behavior, I must do this<br />
var decA:IDecA = decorated.retreiveDecorator( IDecA ) as IDecA;<br />
if( decA != null )<br />
{<br />
   // access decA behavior here<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Laurence Taylor</title>
		<link>http://virtualnomad.net/2007/11/17/aspect-oriented-programming-in-actionscript3/#comment-6</link>
		<dc:creator>Laurence Taylor</dc:creator>
		<pubDate>Tue, 18 Dec 2007 13:13:50 +0000</pubDate>
		<guid isPermaLink="false">http://virtualnomad.net/2007/11/17/aspect-oriented-programming-in-actionscript3/#comment-6</guid>
		<description>I’ve been investigating this recently, trying to reverse engineer the aop framework found in as2lib, and I’ve come to exactly the same conclusion. I think adobe are open sourcing the flex compiler, and that would open up the possibility. Alternatively, something might come from the haxe assembly library, hxasm.
</description>
		<content:encoded><![CDATA[<p>I’ve been investigating this recently, trying to reverse engineer the aop framework found in as2lib, and I’ve come to exactly the same conclusion. I think adobe are open sourcing the flex compiler, and that would open up the possibility. Alternatively, something might come from the haxe assembly library, hxasm.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
