Month: December 2013

Multiple Dispatch, Double Dispatch and the Visitor Pattern

I’ve been looking into the Visitor pattern and figuring out how to make it work with overloaded methods. Starting with the abstractions interface IVisitor { void Visit(AbstractElement element); } abstract class AbstractElement { public void Accept(IVisitor visitor) { visitor.Visit(this); } } And initial implementations class TestElement1 : AbstractElement { } partial class TestVisitor1 : IVisitor { public string visitedMethod =… Read more →