Design pattern in .NET: iterator

The iterator pattern plays very important role in STL. In STL, iterators are the glue between algorithms and containers. STL algorithms and containers are independent of each other; each STL container implements its own iterator and the STL algorithms use iterators to access the elements of the containers. For example, there is a for_each algorithm…

0

Design pattern in .NET: template method

GoF’s classical design pattern book has discussed template method pattern: define the skeleton of an algorithm in an operation, deferring some steps to subclasses. Template Method lets subclasses redefine certain steps of an algorithm without changing the algorithm’s structure. We see this pattern in .NET programming also: 1. The dispose pattern Any type that wraps…

0