DEV Community

Discussion on: Understanding Design Patterns: Iterator using Dev.to and Medium social networks!

Collapse
 
jessekphillips profile image
Jesse Phillips

I love the iterator pattern. D defines 5 interfaces and a number of capabilities that an algorithm can require and provides the algorithms.

I have mixed feelings with design patterns and it comes back to what you say about not implementing it as you have done. People will latch on to the hasNext getNext and that becomes the pattern. popFront front would be seen as deviation from the pattern.