Skip to content

Conversation

@peteraritchie
Copy link
Contributor

I was working on some processing ideas and using the decorator pattern to chain together different algorithms. I realized that a decorator can't pass through to all the methods the walker would call. So, a decorated class doesn't get all the information that an undecoreated class (i.e. Enter and Exit, PathString and CurrentKeys.

This pull request makes Enter and Exit virtual and includes a test to make sure the extra two virtual methods an involved.

@darrelmiller
Copy link
Member

I like this. I still somewhat regret breaking the walker and visitor into two classes, but this helps.

@darrelmiller darrelmiller merged commit ff584c7 into microsoft:vnext Dec 15, 2021
@peteraritchie
Copy link
Contributor Author

I like this. I still somewhat regret breaking the walker and visitor into two classes, but this helps.

Would it still be a visitor if the object structure wasn't separated from the algorithm? ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants