Refactoring is the process of changing a software system in such a way that it does not alter the external behavior of the code yet improves its internal structure. – MartinFowler
Refactoring is typically done in small steps. After each small step, you're left with a working system that's functionally unchanged. Practitioners typically interleave bug fixes and feature additions between these steps. So refactoring doesn't preclude changing functionality, it just says that it's a different activity from rearranging code.
Duplicated code 重复的代码 Extract Method,Pull up Method,Template Method.
Long method, Class,Parameter list 过长方法, 类,参数 Extract Method ,Replace Temp with Query,Introduce parameter,Extract Class Extract Subclass Preserve Whole Object
Divergent Change 发散式变化 class 因不同原因在不同方向变化,一种变化导致类内修改几个函数, extract class
Shotgun Surgery 霰弹式变化 一个变化需要到不同的类去做修改,散布各处 Move Method Move Field,Inline Class
0 comments
Post a comment