์นดํ๋ก๊ทธ ์ค๋ช ์ ๋ณด๊ธฐ์ ์ ์ด๋ป๊ฒ ์ฝ์ผ๋ฉด ์ข์์ง ์์๋ณด์.
๋ฆฌํฉํฐ๋ง ์ค๋ช ํ์
- ์ด๋ฆ
- ๊ฐ์: ํต์ฌ ๊ฐ๋
์ด ๋ฌด์์ธ๊ฐ?
- ๋์ค์ ์ฐพ์๋ณผ ๋, ์ด๊ฒ ์ด๋ค๊ฑด์ง ์ฝ๊ฒ ๋ ์ฌ๋ฆฌ๊ธฐ ์ํ ๊ฒ.
- ๋ฐฐ๊ฒฝ: ์ด ๊ธฐ๋ฒ์ด ์ ํ์ํ๊ฐ?
- ์ ์ฐจ: ์ด๋ป๊ฒ ์ฒ๋ฆฌํ๋ฉด ๋๋์ง์ ๋ํ ๊ณผ์
- ๋ฆฌํฉํ ๋ง ๋จ๊ณ๋ฅผ ์๊ฒ ๋๋์ด ํด์ผํ๋ ์ง์นจ๋ค.
- ์์: ์ค์ ์ฝ๋๋ฅผ ๋ณด์ฌ์ค๋ค.
- ์ฒ์์๋ ์์๋ถํฐ ๋ณด์.
- ๊ทธ๋ฆฌ๊ณ ์์๋ ๋งค์ฐ ๊ฐ๋จํ ๊ฒ์ผ๋ก ๊ตฌ์ฑํ๋ค.
Basic Refactoring
- 12. Extract Function
- 13. Inline Function
- 14. Extract Variable
- 15. Inline Variable
- 16. Change Function Declaration
- 17. Encapsulate Variable
- 18. Rename Variable
- 19. Make Parameter Object
- 20. Combine Functions into Class
- 21. Combine Functions into Transform
- 22. Split Phase
Encapsulation
- 23. Encapsulate Record
- 24. Encapsulate Collection
- 25. Replace Primitive with Object
- 26. Replace Temp With Query
- 27. Extract Class
- 28. Inline Class
- 29. Hide Delegate
- 30. Remove Middle Man
- 31. Substitute Algorithm
Move Features
- 32. Move Function
- 33. Move Field
- 34. Move Statement into Function
- 35. Move Statements to Callers
- 36. Replace Inline Code With Function Call
- 37. Slide Statements
- 38. Split Loop
- 39. Replace Loop with Pipeline
- 40. Remove Dead Code
Data Organization
- 41. Spilt Variable
- 42. Rename Field
- 43. Replace Derived Variable With Query
- 44. Change Reference To Value
- 45. Change Value To Reference
Simplifying conditional logic
- 46. Decompose Conditional
- 47. Consolidate Conditional Expression
- 48. Replace Nested Conditional With Guard Clauses
- 49. Replace Conditional With Polymorphism
- 50. Introduce Special Case
- 51. Introduce Assertion
API Refactoring
- 52. Separate Query From Modifier
- 53. Parameterize Function
- 54. Remove Flag Argument
- 55. Preserve Whole Object
- 56. Replace Parameter With Query
- 57. Replace Query with Parameter
- 58. Remove Setting method
- 59. Replace Constructor with Factory Method
- 60. Replace Function with Command
- 61. Replace Command with Function
Dealing with Inheritance
- 62. Pull up Methods
- 63. Pull up Field
- 64. Pull up Constructor Body
- 65. Push down Method
- 66. Push down Field
- 67. Replace Type Code with SubClasses
- 68. Remove Subclass
- 69. Extract SuperClass
- 70. Collapse Hierarchy
- 71. Replace SubClass with Delegate
- 72. Replace SuperClass with Delegate