April 2019
Intermediate to advanced
360 pages
9h 17m
English
The purpose of the iterator design pattern is to grant access to an object's members without sharing the encapsulated data structures. There are two main motivations for using the iterator design pattern. First, not all object data is stored in the same manner. For example, an online store that aggregates content from other vendors might have a vendor that uses an array, another that uses a list, and a third that uses an ArrayList. A second reason is to avoid exposing data structures. Both the variability of storage approaches and data security can be addressed with the iterator design pattern.
The iterator design pattern is implemented by using the Iterator interface, part of the java.util package.
We will look ...
Read now
Unlock full access