Skip to content

Latest commit

 

History

History
12 lines (11 loc) · 1.22 KB

File metadata and controls

12 lines (11 loc) · 1.22 KB

Refactoring Technics

  • Extract method: Move a block of code into a separate method with a descriptive name.
  • Extract variable: Replace an expression with a descriptive variable name.
  • Rename: Rename a class, method, or variable to make its purpose clearer.
  • Inline: Replace a method call with the contents of the method.
  • Replace conditional with polymorphism: Replace a conditional statement with polymorphism (using inheritance or interface implementation) to make the code more flexible and maintainable.
  • Replace loop with pipeline: Replace a loop with a pipeline of functions to make the code more readable and easier to maintain.
  • Extract class: Move a group of related methods and variables into a separate class.
  • Replace inheritance with delegation: Replace inheritance with delegation (using composition) to improve the flexibility and maintainability of the code.
  • Replace magic numbers with constants: Replace "magic numbers" (hard-coded values) with named constants to make the code more readable and maintainable.
  • Consolidate duplicated code: Remove duplicated code by extracting common functionality into a separate method.