-
Notifications
You must be signed in to change notification settings - Fork 0
iterator
-
Iterator Pattern: provides a way to access the elements of an aggregate object sequentially without exposing its underlying representation.
-
A class should have only one reason to change. This principle guides us to keep each class to a single responsibility.
-
The Composite Pattern: allows you to compose objects into tree structures to represent part-whole hierarchies. Composite lets clients treat individual objects and compositions of objects uniformly.
-
The composite pattern allows us to build structures of objects in the form of trees that contain both compositions of objects and individual objects as nodes.
-
Using a composite structure, we can apply the same operations over both composites and individual objects. In other words, in most cases we can ignore the differences between compositions of objects and individual objects.