Iteration and the Visitor Pattern
Review Questions
1. |
What is a design pattern? What is an example of a design pattern? Why would you use it? |
2. |
Why does the FileVisitor need to be recursive? |
3. |
There are three kinds of design patterns: structural, creational, and behavioral. Which kind is the visitor? Why? |
4. |
FileVisitor could be used to make changes to selected files. Testing such an app would be quite risky. How would you do it? |