重构31天

    Refactoring 1: Encapsulate Collection【重构第一式:封装集合】

    Refactoring 2: Move Method【重构第二式:搬移方法】

    Refactoring 3: Pull Up Method【重构第三式:上移方法】

    Refactoring 4: Pull Up Field【重构第四式:上移字段】

    Refactoring 5: Push Down Method【重构第五式:下移方法】

    Refactoring 6: Push Down Field【重构第六式:下移字段】

    Refactoring 7: Rename(method,class,parameter)【重构第七式:重命名(方法,类,参数)】

    Refactoring 8: Replace Inheritance with Delegation【重构第八式:用委托取代继承】

    Refactoring 9: Extract Interface【重构第九式:提取接口】

    Refactoring 10: Extract Method【重构第十式:提取方法】

    Refactoring 11: Switch to Strategy【重构第十一式:重构条件语句为策略模式】

    Refactoring 12: Break Dependencies【重构第十二式:消除依赖

    Refactoring 13: Extract Method Object【重构第十三式:提取方法对象】

    Refactoring 14: Break Responsibilities【重构第十四式:分离职责】

    Refactoring 15: Remove Duplication【重构第十五式:去除重复代码】

    Refactoring 16: Encapsulate Conditional【重构第十六式:封装条件表达式

    Refactoring 17: Extract Superclass【重构第十七式:提取父类】

    Refactoring 18: Replace exception with conditional【重构第十八式:用条件语句取代异常】

    Refactoring 19: Extract Factory Class【重构第十九式:提取工厂类】

    Refactoring 20: Extract Subclass【重构第二十式:提取子类】

    Refactoring 21: Collapse Hierarchy【重构第二十一式:合并继承层次结构】

    Refactoring 22: Break Method【重构第二十二式:分解方法】

    Refactoring 23: Introduce Parameter Object【重构第二十三式:引入参数对象】

    Refactoring 24: Remove Arrowhead Antipattern【重构第二十四式:去除复杂的嵌套条件判断】

    Refactoring 25: Introduce Design By Contract checks【重构第二十五式:引入契约式设计验证】

    Refactoring 26: Remove Double Negative【重构第二十六式:消除双重否定】

    eg:例如经常使用的if(!StringUtils.isEmpty)可改用StringUtils.isNotBlank()代替

    Refactoring 27: Remove God Classes【重构第二十七式:去除上帝类】

    eg:开发中有时图省事会使用CommonUtils包含字符串,数字,日期等各种处理,应该将起拆分成StringUtils,DateUtils等

    Refactoring 28: Rename boolean method【重构第二十八式:重命名布尔方法】

    Refactoring 29: Remove Middle Man【重构第二十九式:去除中间人】

    Refactoring 30: Return ASAP【重构第三十式:尽快返回】

    Refactoring 31: Replace conditional with Polymorphism【重构第三十一式:用多态取代条件语句】
 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值