News for hackers. Stuff that matters.
Re:The visitor pattern is essentially the same thing as Chur... by Twisol on Thursday February 04, 2021 @01:37PM (#26028372)
That's why we usually group all of these handlers into a single Visitor interface. Then you only add one class and one extra method to the Visitor, and all the other variants stay the same.

You're brushing up against the so-called "expression problem", though, where you can choose between adding types easily or adding algorithms easily, but not usually both.

There are no comments on this comment yet.