重构: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. 当有
相关文章
相关标签/搜索