3 ms·
But in the GoF visitor pattern, the "case statement" is in fact centralized in one place: In the class implementing the visitor. And of course you can have the
by vidarh 11y ago
But in the GoF visitor pattern, the "case statement" is in fact centralized in one place: In the class implementing the visitor.
And of course you can have the equivalent in C++/Java and similar languages, but that would lose the main benefit of having the completeness of the visitor statically checked (In other words, you can write dynamically typed code in any language some way or the).