CloudCoders / Design-Patterns

Project for learning and discuss about design patterns
16 stars 1 forks source link

Iterator #42

Closed pedrodaviddev closed 7 years ago

pedrodaviddev commented 7 years ago

Implemented iterator: NormalIterator is a basic example for iterator. This is what I just implemented. RandomIterator and BackwardsIterator are two useful uses for Iterator. I thought that could be interesting to show more implementations of Iterator, to show the real power of Iterator!

tonilopezmr commented 7 years ago

I think you have made a grave mistake @Nhemesy. Yours iterators wraps a real list without remove the link reference with the list from constructor.

Normally a iterator create a list clone that receives from constructor to for example remove while iterates in list, or something like that.

Also I think that maybe this is irrelevant for the design pattern 🤔 but it is a good improvement.