Form traversal
Aha... the code in my previous post was very nice but on second inspection, breadth first traversal proved to be more complicated than that. In fact, the complication was so great that I deleted two classes that were getting in the way.
I had separated traversing a form from the stream on the form, so I had a 3-layer stack: traversal on a stream on a form.
But the traversal is itself a type of stream, so it's silly so have it stream a stream. So FormStreams are gone.
I realized how limited is the scope of traversal in typical collection streams. So for form traversal (which is pretty much graph traversal), stream feels like a bad name because it brings with it connotations of streaming arrays or serial ports.
So now the design is a 2-layer stack: traversal on a form. The cost of this is that the traversing methods are longer. On the other hand, there's no position keeping necessary since forms already provide linkage. Not bad... let's see what some refactoring can do.

No comments:
Post a Comment