美文网首页
代码重构的方法

代码重构的方法

作者: ImClive | 来源:发表于2018-05-09 13:59 被阅读0次
    1. Add Parameter
    2. Change Bidirectional Association to Undirectional
    3. Change Reference to Value
    4. Change Undirectional Association to Bidirectional
    5. Change Value to Reference
    6. Collapse Hierarchy
    7. Consolidate Conditional Expression
    8. Consolidate Duplicate Conditional Fragments
    9. Convert Procedural Design to Objects
    10. Decompose Conditional
    11. Duplicate Observed Data
    12. Encapsulate Collection
    13. Encapsulate Downcast
    14. Encapsulate Field
    15. Extract Class
    16. Extract Hierarchy
    17. Extract Interface
    18. Extract Method
    19. Extract Subclass
    20. Extract Superclass
    21. Form Template Method
    22. Hide Delegate
    23. Hide Method
    24. Inline Class
    25. Inline Method
    26. Inline Temp
    27. Introduce Assertion
    28. Introduce Explaining Variable
    29. Introduce Foreign Method
    30. Introduce Local Extension
    31. Introduce Null Object
    32. Introduce Parameter Object
    33. Move Field
    34. Move Method
    35. Parameterize Method
    36. Preserve Whole Object
    37. Pull Up Constructor Body
    38. Pull Up Field
    39. Pull Up Method
    40. Push Down Field
    41. Push Down Method
    42. Remove Assignments to Parameters
    43. Remove Control Flag
    44. Remove Middle Man
    45. Remove Setting Method
    46. Rename Method
    47. Replace Array with Object
    48. Replace Conditional with Polymorphism
    49. Replace Constructor with Factory Method
    50. Replace Data Value with Object
    51. Replace Delegation with Inheritance
    52. Replace Error Code with Exception
    53. Replace Exception with Test
    54. Replace Inheritance with Delegation
    55. Replace Magic Number with Symbolic Constant
    56. Replace Method with Method Object
    57. Replace Nested Conditional with Guard Clauses
    58. Replace Parameter with Explicit Methods
    59. Replace Parameter with Methods
    60. Replace Record with Data Class
    61. Replace Subclass with Fields
    62. Replace Temp with Query
    63. Replace Type Code with Class
    64. Replace Type Code with State/Strategy
    65. Replace Type Code with Subclasses
    66. Self Encapsulate Field
    67. Separate Domain from Presentation
    68. Separate Query from Modifier
    69. Split Temporary Variable
    70. Substitute Algorithm
    71. Tease Apart Inheritance

    相关文章

      网友评论

          本文标题:代码重构的方法

          本文链接:https://www.haomeiwen.com/subject/acinrftx.html