摘要: 重构之Pull up Method 与Push Down Method 上移方法(Pull Up Method)重构是在继承链中,当一个方法被多个实现者使用时,将方法向继承链上层迁移的过程。 修改前代码 Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--... 阅读全文
posted @ 2010-08-14 23:20 jasen.kin 阅读(512) 评论(0) 推荐(0) 编辑
摘要: 重构之Pull up Method 与Push Down Method 上移方法(Pull Up Method)重构是在继承链中,当一个方法被多个实现者使用时,将方法向继承链上层迁移的过程。 修改前代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--... 阅读全文
posted @ 2010-08-14 23:16 jasen.kin 阅读(532) 评论(0) 推荐(0) 编辑
摘要: 重构:Move Method Move Method就是将方法迁移到合适的位置。 条件:当一个方法被其他类使用比在它所在类中的使用还要频繁时,我们就需要将方法迁移到更频繁地使用它的类中(Move Method重构) 范例如下:修改前代码 Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHi... 阅读全文
posted @ 2010-08-14 00:21 jasen.kin 阅读(412) 评论(0) 推荐(0) 编辑