Relative Content

Tag Archive for c#design-patternsvisitor-pattern

How to set an internal property using the Visitor Pattern?

I have the following (simplified) interfaces and classes (in C#). In this simplified example, I am modeling algebraic binary expressions exploiting the Visitor Pattern for their computation. I have expressions which evaluate to integer numbers and they can be composed of additions, multiplications, and integer numbers. The expressions are designed to be immutable thus, once an expression has been computed, i can save its value in the field Value.