Replace Conditional with Polymorphism
You have a conditional that chooses different behavior depending on the type of an object.
Move each leg of the conditional to an overriding method in a subclass. Make the original method abstract.
转载
2013-12-30 18:00:23 ·
1044 阅读 ·
0 评论