<?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/"
	xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule"
	>
<channel>
	<title>Comments on: The Iterator Pattern: Flexible implementation of collections</title>
	<atom:link href="http://www.as3dp.com/2008/09/04/the-iterator-pattern-flexible-implementation-of-collections/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.as3dp.com/2008/09/04/the-iterator-pattern-flexible-implementation-of-collections/</link>
	<description>OOP Techniques for Flash and Flex Developers</description>
	<lastBuildDate>Wed, 10 Mar 2010 17:32:01 -0800</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: noponies</title>
		<link>http://www.as3dp.com/2008/09/04/the-iterator-pattern-flexible-implementation-of-collections/comment-page-1/#comment-2710</link>
		<dc:creator>noponies</dc:creator>
		<pubDate>Tue, 21 Jul 2009 10:13:13 +0000</pubDate>
		<guid isPermaLink="false">http://www.as3dp.com/?p=137#comment-2710</guid>
		<description>Thanks for this example, very handy.</description>
		<content:encoded><![CDATA[<p>Thanks for this example, very handy.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Flug</title>
		<link>http://www.as3dp.com/2008/09/04/the-iterator-pattern-flexible-implementation-of-collections/comment-page-1/#comment-886</link>
		<dc:creator>Flug</dc:creator>
		<pubDate>Thu, 20 Nov 2008 17:09:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.as3dp.com/?p=137#comment-886</guid>
		<description>Hey your code works great! Hopefuly that you create more codes which are useful like this one. Thx</description>
		<content:encoded><![CDATA[<p>Hey your code works great! Hopefuly that you create more codes which are useful like this one. Thx</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chandima</title>
		<link>http://www.as3dp.com/2008/09/04/the-iterator-pattern-flexible-implementation-of-collections/comment-page-1/#comment-854</link>
		<dc:creator>Chandima</dc:creator>
		<pubDate>Tue, 28 Oct 2008 18:59:19 +0000</pubDate>
		<guid isPermaLink="false">http://www.as3dp.com/?p=137#comment-854</guid>
		<description>Hi Rolf,

Thanks for pointing out the &quot;infinite loop&quot; problem. I did see some implementations out in the wild that had separate methods to advance the pointer and access data but decided to go with the implementation that had the simplest interface -- the simpler solution is almost always the right one!!! I do like your collections package where you cast the LinkedList class to the interface you need and use it as a stack, queue etc.... pretty nifty!</description>
		<content:encoded><![CDATA[<p>Hi Rolf,</p>
<p>Thanks for pointing out the &#8220;infinite loop&#8221; problem. I did see some implementations out in the wild that had separate methods to advance the pointer and access data but decided to go with the implementation that had the simplest interface &#8212; the simpler solution is almost always the right one!!! I do like your collections package where you cast the LinkedList class to the interface you need and use it as a stack, queue etc&#8230;. pretty nifty!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: rolf vreijdenberger</title>
		<link>http://www.as3dp.com/2008/09/04/the-iterator-pattern-flexible-implementation-of-collections/comment-page-1/#comment-853</link>
		<dc:creator>rolf vreijdenberger</dc:creator>
		<pubDate>Tue, 28 Oct 2008 17:38:13 +0000</pubDate>
		<guid isPermaLink="false">http://www.as3dp.com/?p=137#comment-853</guid>
		<description>@TK: iteration in trees is handled differently as there are multiple ways of touching all the nodes in a tree. This is called traversing a tree. A Tree can have an iterator, but this will most probably be an implementation of a traversal mechanism like postorder, inorder, preorder or levelorder.
you can check out our site and the as3 opensource package containing data structures in our collections package (including iterators and trees with traversal and iterator mechanisms). Full documentation and source code available, plus unittesting in place.

@chandima: thank you for providing an excellent use of iterators!
The bad way would be to make a call to iterator.next(); and then seperately getting the data in iterator.getData(); or the likes.
This allows for infinite loops when forgetting the call to iterator.next(). Your iterator implementation, which is the same as the Java iterator (on which we also based our implementations) is foolproof in this regard :)
The iterator patterns is fully incorporated in our IList interface and List implementations, and features some nice modifications like extended iterators, and unmodifyable iterators.
The list (and the whole package actually) is heavily leaning on design patterns and I guess you&#039;ll really like them :)</description>
		<content:encoded><![CDATA[<p>@TK: iteration in trees is handled differently as there are multiple ways of touching all the nodes in a tree. This is called traversing a tree. A Tree can have an iterator, but this will most probably be an implementation of a traversal mechanism like postorder, inorder, preorder or levelorder.<br />
you can check out our site and the as3 opensource package containing data structures in our collections package (including iterators and trees with traversal and iterator mechanisms). Full documentation and source code available, plus unittesting in place.</p>
<p>@chandima: thank you for providing an excellent use of iterators!<br />
The bad way would be to make a call to iterator.next(); and then seperately getting the data in iterator.getData(); or the likes.<br />
This allows for infinite loops when forgetting the call to iterator.next(). Your iterator implementation, which is the same as the Java iterator (on which we also based our implementations) is foolproof in this regard :)<br />
The iterator patterns is fully incorporated in our IList interface and List implementations, and features some nice modifications like extended iterators, and unmodifyable iterators.<br />
The list (and the whole package actually) is heavily leaning on design patterns and I guess you&#8217;ll really like them :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: TK</title>
		<link>http://www.as3dp.com/2008/09/04/the-iterator-pattern-flexible-implementation-of-collections/comment-page-1/#comment-749</link>
		<dc:creator>TK</dc:creator>
		<pubDate>Sat, 20 Sep 2008 01:03:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.as3dp.com/?p=137#comment-749</guid>
		<description>Chandima, have you posted the example anywhere? I&#039;m interested in seeing the use behind the Iterator pattern.

 - TK</description>
		<content:encoded><![CDATA[<p>Chandima, have you posted the example anywhere? I&#8217;m interested in seeing the use behind the Iterator pattern.</p>
<p> &#8211; TK</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chandima</title>
		<link>http://www.as3dp.com/2008/09/04/the-iterator-pattern-flexible-implementation-of-collections/comment-page-1/#comment-733</link>
		<dc:creator>Chandima</dc:creator>
		<pubDate>Mon, 08 Sep 2008 18:13:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.as3dp.com/?p=137#comment-733</guid>
		<description>@TK, you suggestion gave me an idea for an example app - one that uses the iterator pattern to traverse the display list which is a composite tree structure. For example, if you have a complex object in Flash such as a spaceship that has several embedded MovieClips ( engines, fuel tanks etc. ). You can use the iterator pattern to do hit-testing against the embedded components. So, for example, each embedded component can take separate damage when hit by a missile.</description>
		<content:encoded><![CDATA[<p>@TK, you suggestion gave me an idea for an example app &#8211; one that uses the iterator pattern to traverse the display list which is a composite tree structure. For example, if you have a complex object in Flash such as a spaceship that has several embedded MovieClips ( engines, fuel tanks etc. ). You can use the iterator pattern to do hit-testing against the embedded components. So, for example, each embedded component can take separate damage when hit by a missile.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chandima</title>
		<link>http://www.as3dp.com/2008/09/04/the-iterator-pattern-flexible-implementation-of-collections/comment-page-1/#comment-732</link>
		<dc:creator>Chandima</dc:creator>
		<pubDate>Mon, 08 Sep 2008 18:04:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.as3dp.com/?p=137#comment-732</guid>
		<description>Hi John, thanks for the note. I wanted to keep the SimpleList interface really bare to minimize distractions in understanding the core pattern. We are constantly grappling with how minimalist the examples should be without relegating them to irrelevance. It&#039;s very helpful to get feedback on this issue as sometimes we miss the mark. I&#039;m working on a more practical example that my help in showing how &quot;solid&quot; this pattern can be and will post a link here as soon as it&#039;s done.</description>
		<content:encoded><![CDATA[<p>Hi John, thanks for the note. I wanted to keep the SimpleList interface really bare to minimize distractions in understanding the core pattern. We are constantly grappling with how minimalist the examples should be without relegating them to irrelevance. It&#8217;s very helpful to get feedback on this issue as sometimes we miss the mark. I&#8217;m working on a more practical example that my help in showing how &#8220;solid&#8221; this pattern can be and will post a link here as soon as it&#8217;s done.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: TK</title>
		<link>http://www.as3dp.com/2008/09/04/the-iterator-pattern-flexible-implementation-of-collections/comment-page-1/#comment-730</link>
		<dc:creator>TK</dc:creator>
		<pubDate>Sat, 06 Sep 2008 22:37:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.as3dp.com/?p=137#comment-730</guid>
		<description>Yeah, looking forward to seeing how a tree would be traversed in this fashion. I&#039;m an AS3 guy and I&#039;m starting to code in Java and I don&#039;t really see too much use for an iterator at this point. Thanks for the pattern!

 - TK</description>
		<content:encoded><![CDATA[<p>Yeah, looking forward to seeing how a tree would be traversed in this fashion. I&#8217;m an AS3 guy and I&#8217;m starting to code in Java and I don&#8217;t really see too much use for an iterator at this point. Thanks for the pattern!</p>
<p> &#8211; TK</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John C. Bland II</title>
		<link>http://www.as3dp.com/2008/09/04/the-iterator-pattern-flexible-implementation-of-collections/comment-page-1/#comment-728</link>
		<dc:creator>John C. Bland II</dc:creator>
		<pubDate>Fri, 05 Sep 2008 00:38:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.as3dp.com/?p=137#comment-728</guid>
		<description>Great post as usual. I didn&#039;t read it fully but scanned the code.

It probably would be good for folks looking to learn the Iterator to see how you add and remove items from the internal list. That would round out the post so folks can see how solid this pattern can be.</description>
		<content:encoded><![CDATA[<p>Great post as usual. I didn&#8217;t read it fully but scanned the code.</p>
<p>It probably would be good for folks looking to learn the Iterator to see how you add and remove items from the internal list. That would round out the post so folks can see how solid this pattern can be.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
