10个重构小技巧
2020-06-01 11:56:40 1 举报
AI智能生成
10个重构小技巧
作者其他创作
大纲/内容
1.重复代码的提炼
Bad Example
Good Example
2.冗长方法的分割
Bad Example
Good Example
3.嵌套条件分支的优化
Bad Example
Good Example
4.去掉一次性的临时变量
Bad Example
Good Example
5.消除过长参数列表
Bad Example
Good Example
6.提取类或继承体系中的常量
Bad Example
Good Example
7.让类提供应该提供的方法
Bad Example
Good Example
8.拆分冗长的类
9.提取继承体系中重复的属性与方法到父类
10.看看自己的代码吧
0 条评论
下一页