- Scala Design Patterns.
- Ivan Nikolov
- 57字
- 2021-08-27 19:09:47
The iterator design pattern
The iterator design pattern is when an iterator is used to traverse a container and access its elements. It helps to decouple containers from the algorithms performed on them. What an iterator should provide is sequential access to the elements of an aggregate object without exposing the internal representation of the iterated collection.