![]() ![]() New access and traversal operations can be defined independently by defining new iterators. Clients use an iterator to access and traverse an aggregate without knowing its representation (data structures).ĭifferent iterators can be used to access and traverse an aggregate in different ways.Define a separate (iterator) object that encapsulates accessing and traversing an aggregate object.What solution does the Iterator design pattern describe? Later without having to change the aggregate interface. New traversal operations should be defined for an aggregate object without changing its interface.ĭefining access and traversal operations in the aggregate interface is inflexible because it commits the aggregate to particular access and traversal operations and makes it impossible to add new operations.The elements of an aggregate object should be accessed and traversed without exposing its representation (data structures). ![]() What problems can the Iterator design pattern solve? That describe how to solve recurring design problems to design flexible and reusable object-oriented software, that is, objects that are easier to implement, change, test, and reuse. Design pattern is one of the twenty-three well-known
0 Comments
Leave a Reply. |