C# refactoring

    In 2009, Sean Chambers published a series of articles on his blog 31 Days of Refactoring: Useful refactoring techniques you have to know , one article a day, introducing a method of refactoring, and 31 articles in a row, hence the name "Refactoring Three" Eleven Days: Refactoring Tools You Should Master". In addition, Sean Chambers organized these 31 articles [that is, 31 reconstruction methods] into an e-book. The following are the original blog link and e-book download address:

       Original blog post: http://lostechies.com/seanchambers/2009/07/31/31-days-of-refactoring/

       E-book download address: http://lostechies.com/wp-content/uploads/2011/03/31DaysRefactoring.pdf


    Refactoring 1: Encapsulate Collection [Refactoring Type 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 Seventh Form: 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【重构第二十六式:消除双重否定】

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

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

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

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

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


      在本系列文章写作过程中,参考了麒麟.NET的翻译版本《31天重构速成 :你必须知道的重构技巧》以及圣殿骑士(Knights Warrior)《31天重构学习笔记》


Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324207528&siteId=291194637