The Iterator Pattern
4 min readJan 23, 2022
The iterator pattern is a design pattern which can be used to decouple (traversal) algorithms from containers.
We’ll take a look into what it actually is, how to apply it, and which problems it solves!
What does it state?
1. The elements of an aggregate object should be accessed and traversed without exposing its representation (underlying data structure)