skip to Main Content

Welcome

Say hello to the toggle bar. This is an optional section you can use to display any content you'd like. Simply select a page from the theme panel and the content of the page will display here. You can even use the drag and drop builder to create this! This is a perfect place for your company mission statement, alerts, notices or anything else.

Get In Touch

Email: support@total.com
Phone: 1-800-Total-Theme
Address: Las Vegas, Nevada

Our Location

togglebar-map

Iterator Pattern

Post Series: Behavioral Design Pattern

This pattern is provides a way to access the elements of a collection object in sequential manner without knowing its underlying structure.

Iterator Design Pattern C#

  • Client: This is the class that contains an object collections and uses Next operation of the iterator to retrieve items from the aggregate in an appropriate sequence.
  • Iterator: This is an interface that defines operations for accessing the collection elements in a sequence.
  • ConcreteIterator: This is a class that implements Iterator interface.
  • Aggregate: This is an interface which defines an operation to create an iterator.
  • ConcreteAggregate: This is a class that implements Aggregate interface.

Implement

Usage

  1. Allows to access the elements of a collection object in sequential manner without knowing its underlying structure.
  2. Multiple or concurrent iterations are required over collections elements.
  3. Provides a uniform interface for accessing the collection elements.

Resource

http://www.dotnettricks.com/learn/designpatterns/iterator-design-pattern-c-sharp

https://viblo.asia/p/design-pattern-iterator-QWkwGn3nv75g

Leave a Reply

Your email address will not be published. Required fields are marked *

Back To Top