I have a love-hate relationship with the Visitor pattern; sometimes it seems the best (only) way of solving the problem in front of you, but it still feels unwieldy, hard to follow and honestly a bit of a hack.
If I can, I'll treat the temptation to use Visitor as a clue that the model is wrong and refactor ;)
I have a love-hate relationship with the Visitor pattern; sometimes it seems the best (only) way of solving the problem in front of you, but it still feels unwieldy, hard to follow and honestly a bit of a hack.
If I can, I'll treat the temptation to use Visitor as a clue that the model is wrong and refactor ;)
What kind of problems have you solved with it? I know that it fits best when processing e.g. tree structures.
Exactly - operations on a graph of objects of different classes.