In this project, it is implemented a toy example of a “Double Dispatch” in Java.
The implementation is achieved via the Visitor pattern.
Alternative solutions to the problem are also provided: a naive one, not working, and another one, working, which however makes use of some anti-patterns.
Unit Tests aimed at demonstrating the above points are provided.
The branch visitor_pattern_kata
is aimed at providing a basis for applying for a code kata: it contains the very same code as the master
but:
- the actual implementation of the visitor as been removed ⇒ you must figure out how to implement it in order to make the tests pass
- some other classes and tests not needed for the kata have been removed