hi,
i read through fowler's refactoring: Replace Conditional with
Polymorphism.
fowler presents this kind of solution:
but why isn't fowler going even further and uses 'instanceof':
to me the latter code is a better solution. does anybody know why fowler is not going for the more typesafe 'instanceof'? he must have had a reason...
thank you.