Stephan van Hulst wrote:Almost, but not quite.
Al Hobbs wrote:You mention casting. You could just add another another method to the visitor that accepts ConcreteA or SpecialConcreteA. The purpose of the visitor is to allow flexibility with different types of implementations for different data types.
Coi Saurus wrote:
i cant avoid of casting on each visitor to the concrete TypeOfResponse,because the Visitor interface 'visit' a ResponseType,not a concretion.
Coi Saurus wrote:Doing that ,i am forced to implement [...] in classes where i just need to give an implementation to just ONE of both.