Polski

Behavioral patterns

Iterator

Walks through a collection without exposing how it is stored.

Article

Iterator: walking a collection without looking inside

The Iterator pattern through orders from a delivery app fetched page by page: the loop in the report knows nothing about pagination, and pages load lazily, only when needed. Generators, yield and iter.Seq in five languages.

Related articles

Challenges

Around the topic

In this group: Behavioral patterns