Talk:Iterator pattern

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia

This is one of my first pages created on Wikipedia. Could someone help this page get exposure and turn it into a stub template?

Lababidi 05:06, 18 April 2006 (UTC)[reply]

Clarify the number of methods clause[edit]

Why 7 methods? sCan anyone explain this more clearly? --Quaestor23 17:56, 14 February 2007 (UTC)[reply]

Yes - why 7? Is it one for each concrete class to get the iterator, and then three for the iterator itself? mick wood May 3rd 2007

Attribute the definition[edit]

The first line has the clause: "access the elements of an aggregate object sequentially without exposing its underlying representation" which seems to have been extracted from the Gang-of-Four book (http://en.wikipedia.org/wiki/Design_Patterns) according to the attribution here: http://home.earthlink.net/~huston2/dp/iterator.html If someone has the book could they verify? --arkul 04:45, 26 August 2007 (UTC)[reply]

I can confirm that this clause is exactly as it appears on Page 257 of my version of the Gang-of-Four book (Eleventh printing, May 1997) —Preceding unsigned comment added by TheThiefOfTime (talkcontribs) 11:00, 13 May 2008 (UTC)[reply]

Merger proposal[edit]

Iterator appears to cover the same subject as this page, but in much more detail.

Reply: both entries seem desirable and apt. It seems desirable to link the two -- something this current query is achieving.

Iterator provides excellent implementation details for those aware of design patterns who are seeking information on this particular pattern.

The iterator design pattern entry is helpful for those seeking information on what design patterns are [or, as in my search, in seeking an explanation of iterator in a design pattern context].--150.135.48.70 18:22, 9 November 2007 (UTC)[reply]

I also came here while researching each of the GoF Design Patterns. 72.42.76.43 (talk) 20:43, 1 August 2008 (UTC)[reply]


Examples not language specific[edit]

The examples on this page don't take the language specifics into account. For example the C++ example is a very long implementation by the book which is not typical for C++. The Iterator page offers far better coverage in how different languages implement the Iterator Patter (the concept stays the same).

It also would be nice to demonstrate some other common languages, i.e. Python. —Preceding unsigned comment added by 128.252.20.177 (talk) 19:21, 11 December 2009 (UTC)[reply]

I trimmed the proliferation of language examples on this and other design-pattern pages as they were out of hand and generally didn't contribute to understanding the pattern. However, I think it would make sense to explicitly describe how the iterator pattern interacts with various languages. The semantics are basically the same in all languages, but both C++ and Python (and perhaps others?) have standardized syntax. We shouldn't let this get out of hand, but C++ and Python are both very popular and both use iterators extensively. —Ben FrantzDale (talk) 13:14, 17 December 2010 (UTC)[reply]