I have a WinForms app with an input textbox, button, and a multiline output textbox. A root path is entered in the textbox. Button click calls a function to recursively check all subdirectories for some proper directory naming validation check. The results are output into the multiline textbox.
If the recursive work is done in a separate class, I have two options:
Keep track of improper directories in a class property(e.g. ArrayList),return the ArrayList when done, and update the output textbox with all results.
Pass in ByRef the output textbox and update/refresh it for each improper directory. Even though 1 & 2 are single-threaded, with 2, I would at least get my results updated per directory.
If the recursive work is done in the presentation layer and the validation is done in a separate class, I can multithread.
Which is a cleaner way?