<?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"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Design Patterns in ActionScript-Strategy</title>
	<atom:link href="http://ntt.cc/2008/10/07/gang-of-four-gof-design-patterns-in-actionscript-strategy.html/feed" rel="self" type="application/rss+xml" />
	<link>http://ntt.cc/2008/10/07/gang-of-four-gof-design-patterns-in-actionscript-strategy.html</link>
	<description>Flex,Flash,Ajax and Freebie Resource for Developers and Designers</description>
	<lastBuildDate>Wed, 10 Mar 2010 09:55:10 -0600</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Design Patterns in ActionScript-Final Note - Ntt.cc</title>
		<link>http://ntt.cc/2008/10/07/gang-of-four-gof-design-patterns-in-actionscript-strategy.html/comment-page-1#comment-3455</link>
		<dc:creator>Design Patterns in ActionScript-Final Note - Ntt.cc</dc:creator>
		<pubDate>Tue, 10 Mar 2009 12:58:37 +0000</pubDate>
		<guid isPermaLink="false">http://ntt.cc/2008/10/07/gang-of-four-gof-design-patterns-in-actionscript-strategy.html#comment-3455</guid>
		<description>[...] http://ntt.cc/2008/10/07/gang-of-four-gof-design-patterns-in-actionscript-strategy.html [...]</description>
		<content:encoded><![CDATA[<p>[...] <a href="http://ntt.cc/2008/10/07/gang-of-four-gof-design-patterns-in-actionscript-strategy.html" rel="nofollow">http://ntt.cc/2008/10/07/gang-of-four-gof-design-patterns-in-actionscript-strategy.html</a> [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sike</title>
		<link>http://ntt.cc/2008/10/07/gang-of-four-gof-design-patterns-in-actionscript-strategy.html/comment-page-1#comment-2320</link>
		<dc:creator>sike</dc:creator>
		<pubDate>Sun, 16 Nov 2008 06:45:53 +0000</pubDate>
		<guid isPermaLink="false">http://ntt.cc/2008/10/07/gang-of-four-gof-design-patterns-in-actionscript-strategy.html#comment-2320</guid>
		<description>the UML picture is not so clearly, can you fix it, thanks. :)</description>
		<content:encoded><![CDATA[<p>the UML picture is not so clearly, can you fix it, thanks. <img src='http://ntt.cc/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ciprian Todea</title>
		<link>http://ntt.cc/2008/10/07/gang-of-four-gof-design-patterns-in-actionscript-strategy.html/comment-page-1#comment-2307</link>
		<dc:creator>Ciprian Todea</dc:creator>
		<pubDate>Wed, 12 Nov 2008 20:49:54 +0000</pubDate>
		<guid isPermaLink="false">http://ntt.cc/2008/10/07/gang-of-four-gof-design-patterns-in-actionscript-strategy.html#comment-2307</guid>
		<description>SORRY -&gt; wrong implementation but to not create confusion, that s what i wanted to explain as client use: 
................................................................................
var aStrategyChooser:MovementStrategyManager = new MovementStrategyManager();
aStrategyChooser.Move() // you&#039;ll get ... I want to move .. but have no strategy ... 

aStrategyChooser.strategy = new EagleMovement();
aStrategyChooser.Move(); // will output specific Eagle ... movement .. 
aStrategyChooser.strategy = new PenguinMovement();
aStrategyChooser.Move(); // will output specific Penguin ... movement .. 
// ... etc
...........</description>
		<content:encoded><![CDATA[<p>SORRY -&gt; wrong implementation but to not create confusion, that s what i wanted to explain as client use:<br />
&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;..<br />
var aStrategyChooser:MovementStrategyManager = new MovementStrategyManager();<br />
aStrategyChooser.Move() // you&#8217;ll get &#8230; I want to move .. but have no strategy &#8230; </p>
<p>aStrategyChooser.strategy = new EagleMovement();<br />
aStrategyChooser.Move(); // will output specific Eagle &#8230; movement ..<br />
aStrategyChooser.strategy = new PenguinMovement();<br />
aStrategyChooser.Move(); // will output specific Penguin &#8230; movement ..<br />
// &#8230; etc<br />
&#8230;&#8230;&#8230;..</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ciprian Todea</title>
		<link>http://ntt.cc/2008/10/07/gang-of-four-gof-design-patterns-in-actionscript-strategy.html/comment-page-1#comment-2306</link>
		<dc:creator>Ciprian Todea</dc:creator>
		<pubDate>Wed, 12 Nov 2008 20:34:06 +0000</pubDate>
		<guid isPermaLink="false">http://ntt.cc/2008/10/07/gang-of-four-gof-design-patterns-in-actionscript-strategy.html#comment-2306</guid>
		<description>With all respect ... that is something I can&#039;t call strategy, maybe some kind of decorator .. or smt else.
If Im thinking to a strategy Im thinking to &quot;Something&quot;, it can do some actions &quot;defined&quot; by a &quot;strategy&quot; passed to it ...
Let&#039;s say a bird can Move() ... and that case we can have a IMovementStrategy interface with method signature Move():void. 
Now we can have a specific type of movement (concrete class implementing IMovementStrategy) ... of course with Move() method defined.
As an example:
class PenguinMovement implements IMovementStrategy{
Move():void
{
trace (&#039;Im moving .. not flying so as an animal the strategy is to make steps ... so Im a penguin ... &#039;)
}
}

class EagleMovement implements IMovementStrategy{
Move():void
{
trace (&#039;Im moving .. Im flying .. maybe I will migrate ... so for sure Im an eagle ...&#039;)
}
}

class CarMovement implements IMovementStrategy{
Move():void
{
trace (&#039;Im moving .. I have wheels .. I can be a car .. .lets say some kind of animal :) ... and this is my movement strategy &#039;);
}
}


Now defining the &quot;KEY&quot; class of the Strategy Pattern -&gt; the &quot;director and manipulator&quot; of strategies we ca do smt like that:
class MovementStrategyManager
{
private var _strategy:IMovementStrategy;

public function set strategy( strategy_:IMovementStrategy):void
{
_strategy = strategy_;
}

public function Move():void
{
if (_strategy) _strategy.Move();
else
trace (&#039;I want to move .. but i dont have a strategy of movement ... &#039;)
}
}// end class 

Why and how this can be usefull: 

aStrategyChooser = new MovementStrategyManager();
aStrategyChooser.Move(); // you&#039;ll get ... I want to move .. but have no strategy ... 
aStrategyChooser:IMovementStrategy = new EagleMovement();
aStrategyChooser.Move(); // will output specific Eagle ... movement .. 
// ... etc

... so (in my opinion) this can be a more correct( based on your example ) strategy pattern.

With all respect,
Ciprian</description>
		<content:encoded><![CDATA[<p>With all respect &#8230; that is something I can&#8217;t call strategy, maybe some kind of decorator .. or smt else.<br />
If Im thinking to a strategy Im thinking to &#8220;Something&#8221;, it can do some actions &#8220;defined&#8221; by a &#8220;strategy&#8221; passed to it &#8230;<br />
Let&#8217;s say a bird can Move() &#8230; and that case we can have a IMovementStrategy interface with method signature Move():void.<br />
Now we can have a specific type of movement (concrete class implementing IMovementStrategy) &#8230; of course with Move() method defined.<br />
As an example:<br />
class PenguinMovement implements IMovementStrategy{<br />
Move():void<br />
{<br />
trace (&#8217;Im moving .. not flying so as an animal the strategy is to make steps &#8230; so Im a penguin &#8230; &#8216;)<br />
}<br />
}</p>
<p>class EagleMovement implements IMovementStrategy{<br />
Move():void<br />
{<br />
trace (&#8217;Im moving .. Im flying .. maybe I will migrate &#8230; so for sure Im an eagle &#8230;&#8217;)<br />
}<br />
}</p>
<p>class CarMovement implements IMovementStrategy{<br />
Move():void<br />
{<br />
trace (&#8217;Im moving .. I have wheels .. I can be a car .. .lets say some kind of animal <img src='http://ntt.cc/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  &#8230; and this is my movement strategy &#8216;);<br />
}<br />
}</p>
<p>Now defining the &#8220;KEY&#8221; class of the Strategy Pattern -&gt; the &#8220;director and manipulator&#8221; of strategies we ca do smt like that:<br />
class MovementStrategyManager<br />
{<br />
private var _strategy:IMovementStrategy;</p>
<p>public function set strategy( strategy_:IMovementStrategy):void<br />
{<br />
_strategy = strategy_;<br />
}</p>
<p>public function Move():void<br />
{<br />
if (_strategy) _strategy.Move();<br />
else<br />
trace (&#8217;I want to move .. but i dont have a strategy of movement &#8230; &#8216;)<br />
}<br />
}// end class </p>
<p>Why and how this can be usefull: </p>
<p>aStrategyChooser = new MovementStrategyManager();<br />
aStrategyChooser.Move(); // you&#8217;ll get &#8230; I want to move .. but have no strategy &#8230;<br />
aStrategyChooser:IMovementStrategy = new EagleMovement();<br />
aStrategyChooser.Move(); // will output specific Eagle &#8230; movement ..<br />
// &#8230; etc</p>
<p>&#8230; so (in my opinion) this can be a more correct( based on your example ) strategy pattern.</p>
<p>With all respect,<br />
Ciprian</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: coderkind.com &#187; Blog Archive &#187; OOP in AS3</title>
		<link>http://ntt.cc/2008/10/07/gang-of-four-gof-design-patterns-in-actionscript-strategy.html/comment-page-1#comment-2305</link>
		<dc:creator>coderkind.com &#187; Blog Archive &#187; OOP in AS3</dc:creator>
		<pubDate>Wed, 12 Nov 2008 14:11:46 +0000</pubDate>
		<guid isPermaLink="false">http://ntt.cc/2008/10/07/gang-of-four-gof-design-patterns-in-actionscript-strategy.html#comment-2305</guid>
		<description>[...] http://ntt.cc/2008/10/07/gang-of-four-gof-design-patterns-in-actionscript-strategy.html [...]</description>
		<content:encoded><![CDATA[<p>[...] <a href="http://ntt.cc/2008/10/07/gang-of-four-gof-design-patterns-in-actionscript-strategy.html" rel="nofollow">http://ntt.cc/2008/10/07/gang-of-four-gof-design-patterns-in-actionscript-strategy.html</a> [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>
