Iterator Design Pattern

Iterator Design Pattern

This article describes the Iterator design pattern. This is a behavioral design pattern, a category of design pattern used by software engineers, when writing computer programs.

Introduction

The Iterator pattern is a design pattern, used in software engineering, to iterate through a collection of data. The iterator itself is concerned with the actual implementation of iteration, and provides abstract methods to traverse the data, without needing to know any specifics about the objects in the collection.


It is defined as a behavioral design pattern, because the program uses the iterator in it's execution to perform it's tasks.

Benefits

Abstracting the details of the collection away from the task of sequentially traversing through the objects allows us to process any kind of collection without the tight coupling of having to know anything about the objects. This leads to cleaner and more readable code.

Examples of the pattern

WPF and .Net has the IEnumerable Interface, which returns an IEnumerator.

 

Return to Top


See Also

Link to domain parent articles and related articles in TechNet Wiki.

 

 

Return to Top


Community Resources

These are the external links, including links to Microsoft and TechNet sites that are non-Wiki

 

 

Return to Top


References section

Use this section if you pulled source material and ideas from other sites, blogs, or forums. Make sure you have permission from authors to use their material.

 

  • [Please contribute]

 

 

Return to Top


Leave a Comment
  • Please add 8 and 2 and type the answer here:
  • Post
Wiki - Revision Comment List(Revision Comment)
Sort by: Published Date | Most Recent | Most Useful
Comments
  • XAML guy edited Revision 3. Comment: tweak

  • XAML guy edited Revision 2. Comment: moved link

  • XAML guy edited Revision 1. Comment: tidied sections

  • XAML guy edited Original. Comment: spelling

Page 1 of 1 (4 items)
Wikis - Comment List
Sort by: Published Date | Most Recent | Most Useful
Posting comments is temporarily disabled until 10:00am PST on Saturday, December 14th. Thank you for your patience.
Comments
  • XAML guy edited Original. Comment: spelling

  • XAML guy edited Revision 1. Comment: tidied sections

  • XAML guy edited Revision 2. Comment: moved link

  • XAML guy edited Revision 3. Comment: tweak

Page 1 of 1 (4 items)