Write so let's try to summarize some of the things that we've learned about the visit or design pattern
or at least the double dispatch implementation because we've certainly looked at many implementations
of the visitor.
But the classic one is the one where you essentially you first of all propagate a method called except
throughout the entire hierarchy and then you create a visitor which has a lot of these visit overloads
taking all of the different types inside your hierarchy and then each accept method in each of the elements
in the Harkee simply calls visited this and this is called double dispatch and this is what allows you
to take an existing hierarchy which has this idea of accepting visitors and building new visitors so
that's what allows you to actually add new visitors on the side using inheritance without actually modifying
any of the existing structures in your domain model so to speak.
So this is the classic approach of the visitor.
We also looked at multimethods and the situation where you have this patch on more than one argument
and that's a more complicated situation a situation which you're unlikely to meet in most of the sort
of visitor scenarios.
But there are cases when you do actually hit it.
And unfortunately it's even more painful than the ordinary double dispatch visit.
But I've given you an example to work with so that should be a good starting point.