So something I really hate doing is iterating over a composite, especially complex ones. So I have a program that builds a file system Component using the Composite design pattern. It doesnt take to long to build the entire thing and I have used the Iterator deisgn pattern to build an Iterator class around it. No problem if not annoying to wrap your head around how some if it branches out.
My question is what experience have you had doing this and any gotchas along the way? I re-wrote this based on a recursive design I had before that was blowing the stack every now and then, of course thats not good and thats whay Iterator design is the best.
Just curious, thanks!