Delegates and Visitors in C#(mullr.wordpress.com)
submitted by
mullr(175) 4 years, 7 months ago
The GoF visitor pattern is useful but awkward. The usual c++ or Java-y versions typically involve some kind of visitor interface which your visitor must subclass. Java somewhat mitigates this with anonymous classes, but not fully. In C#, if we’re clever with the use of delegates, we can make tasks like tree traversal look about as simple as iteration.
|category: C#
|Views: 73
tags:
C# another
Everyones tags:
Your Tags: