What is the problem
I have a collection of object of different type and i want add some behaviour without modify existing classes. More specific i want add different behaviour based on object's type.
In our case i have objects of type Ferrari and Maserati and i want modify the property colour of this objects and print some message when i do that (this is the new behaviour). Due to this i want object of
Leggi tutto... (http://blog.intelly-net.com/java/design-pattern/design-pattern-visitor-with-java-reflection.html)
↧