์นดํƒˆ๋กœ๊ทธ ์„ค๋ช…์„ ๋ณด๊ธฐ์ „์— ์–ด๋–ป๊ฒŒ ์ฝ์œผ๋ฉด ์ข‹์€์ง€ ์•Œ์•„๋ณด์ž.

๋ฆฌํŒฉํ„ฐ๋ง ์„ค๋ช… ํ˜•์‹

  • ์ด๋ฆ„
  • ๊ฐœ์š”: ํ•ต์‹ฌ ๊ฐœ๋…์ด ๋ฌด์—‡์ธ๊ฐ€?
    • ๋‚˜์ค‘์— ์ฐพ์•„๋ณผ ๋•Œ, ์ด๊ฒŒ ์–ด๋–ค๊ฑด์ง€ ์‰ฝ๊ฒŒ ๋– ์˜ฌ๋ฆฌ๊ธฐ ์œ„ํ•œ ๊ฒƒ.
  • ๋ฐฐ๊ฒฝ: ์ด ๊ธฐ๋ฒ•์ด ์™œ ํ•„์š”ํ•œ๊ฐ€?
  • ์ ˆ์ฐจ: ์–ด๋–ป๊ฒŒ ์ฒ˜๋ฆฌํ•˜๋ฉด ๋˜๋Š”์ง€์— ๋Œ€ํ•œ ๊ณผ์ •
    • ๋ฆฌํŒฉํ† ๋ง ๋‹จ๊ณ„๋ฅผ ์ž‘๊ฒŒ ๋‚˜๋ˆ„์–ด ํ•ด์•ผํ•˜๋Š” ์ง€์นจ๋“ค.
  • ์˜ˆ์‹œ: ์‹ค์ œ ์ฝ”๋“œ๋ฅผ ๋ณด์—ฌ์ค€๋‹ค.
    • ์ฒ˜์Œ์—๋Š” ์˜ˆ์‹œ๋ถ€ํ„ฐ ๋ณด์ž.
    • ๊ทธ๋ฆฌ๊ณ  ์˜ˆ์‹œ๋Š” ๋งค์šฐ ๊ฐ„๋‹จํ•œ ๊ฒƒ์œผ๋กœ ๊ตฌ์„ฑํ–ˆ๋‹ค.

Basic Refactoring

  1. 12. Extract Function
  2. 13. Inline Function
  3. 14. Extract Variable
  4. 15. Inline Variable
  5. 16. Change Function Declaration
  6. 17. Encapsulate Variable
  7. 18. Rename Variable
  8. 19. Make Parameter Object
  9. 20. Combine Functions into Class
  10. 21. Combine Functions into Transform
  11. 22. Split Phase

Encapsulation

  1. 23. Encapsulate Record
  2. 24. Encapsulate Collection
  3. 25. Replace Primitive with Object
  4. 26. Replace Temp With Query
  5. 27. Extract Class
  6. 28. Inline Class
  7. 29. Hide Delegate
  8. 30. Remove Middle Man
  9. 31. Substitute Algorithm

Move Features

  1. 32. Move Function
  2. 33. Move Field
  3. 34. Move Statement into Function
  4. 35. Move Statements to Callers
  5. 36. Replace Inline Code With Function Call
  6. 37. Slide Statements
  7. 38. Split Loop
  8. 39. Replace Loop with Pipeline
  9. 40. Remove Dead Code

Data Organization

  1. 41. Spilt Variable
  2. 42. Rename Field
  3. 43. Replace Derived Variable With Query
  4. 44. Change Reference To Value
  5. 45. Change Value To Reference

Simplifying conditional logic

  1. 46. Decompose Conditional
  2. 47. Consolidate Conditional Expression
  3. 48. Replace Nested Conditional With Guard Clauses
  4. 49. Replace Conditional With Polymorphism
  5. 50. Introduce Special Case
  6. 51. Introduce Assertion

API Refactoring

  1. 52. Separate Query From Modifier
  2. 53. Parameterize Function
  3. 54. Remove Flag Argument
  4. 55. Preserve Whole Object
  5. 56. Replace Parameter With Query
  6. 57. Replace Query with Parameter
  7. 58. Remove Setting method
  8. 59. Replace Constructor with Factory Method
  9. 60. Replace Function with Command
  10. 61. Replace Command with Function

Dealing with Inheritance

  1. 62. Pull up Methods
  2. 63. Pull up Field
  3. 64. Pull up Constructor Body
  4. 65. Push down Method
  5. 66. Push down Field
  6. 67. Replace Type Code with SubClasses
  7. 68. Remove Subclass
  8. 69. Extract SuperClass
  9. 70. Collapse Hierarchy
  10. 71. Replace SubClass with Delegate
  11. 72. Replace SuperClass with Delegate

Reference