-
메소드 정리 : Remove Assignments to ParametersProgramming/리팩토링 2020. 9. 4. 16:20
참고자료 http://refactoring.guru/remove-assignments-to-parameters Remove Assignments to Parameters Tired of reading? No wonder, it takes 7 hours to read all of the text we have here. Try our interactive course on refactoring. It offers a less tedious approach to learning new stuff. Let's see... refactoring.guru 정의 파라미터에 값을 할당하는 코드가 있으면, 파라미터를 바로 사용하기보단 임수변수에 저장하여 사용하도록 권고한다. 예시 int discount(int inpu..
-
메소드 정리 : Split Temporary VariableProgramming/리팩토링 2020. 9. 4. 16:10
참고자료 http://refactoring.guru/split-temporary-variable Split Temporary Variable Tired of reading? No wonder, it takes 7 hours to read all of the text we have here. Try our interactive course on refactoring. It offers a less tedious approach to learning new stuff. Let's see... refactoring.guru 정의 함수 안에서 지역변수로 만들어진 임시변수가 여러번 할당하는 경우, 각각의 할당에 대해서 임시변수를 만들어 가독성을 올린다. 기존 예시 // Example Code double temp..
-
메소드 정리 : Replace Temp with QueryProgramming/리팩토링 2020. 9. 4. 15:46
참고자료 http://refactoring.guru/replace-temp-with-query Replace Temp with Query Tired of reading? No wonder, it takes 7 hours to read all of the text we have here. Try our interactive course on refactoring. It offers a less tedious approach to learning new stuff. Let's see... refactoring.guru 정의 어떤 수식의 결과값을 저장하기 위해서 임시변수를 사용하고 있다면, 수식을 뽑아내서 함수로 만들고 임시변수를 참조하는 곳을 찾아 모두 메서드 호출로 바꾼다. 기존 예시 double calc..
-
메소드 정리 : Inline TempProgramming/리팩토링 2020. 9. 4. 15:27
참고자료 http://refactoring.guru/inline-temp Inline Temp Tired of reading? No wonder, it takes 7 hours to read all of the text we have here. Try our interactive course on refactoring. It offers a less tedious approach to learning new stuff. Let's see... refactoring.guru 정의 간단한 수식의 결과값을 가지는 임시 변수가 있고, 그 임시변수가 리팩토링을 하는데 방해가 된다면, 임시변수를 잠조하는 부분을 원래의 수식으로 바꾸는 작업이다. 기존 예시 boolean hasDiscount(Order order) ..
-
메소드 정리 : Inline MethodProgramming/리팩토링 2020. 9. 4. 15:20
C++의 인라인 함수랑은 다른 듯..ㅎㅎ 자료참고. http://factoring.guru/inline-method Inline Method Tired of reading? No wonder, it takes 7 hours to read all of the text we have here. Try our interactive course on refactoring. It offers a less tedious approach to learning new stuff. Let's see... refactoring.guru 정의 함수의 몸체가 함수의 이름만큼 명확할 때, 호출하는 곳에 함수의 몸체를 넣고 메서드를 지우는 작업 예시 // Exameple Code int getRating() { return (m..
-
메소드 정리 : Extract MethodProgramming/리팩토링 2020. 9. 4. 14:58
참고자료 https://refactoring.guru/refactoring/catalog Catalog of Refactoring Bloaters are code, methods and classes that have increased to such gargantuan proportions that they are hard to work with. Usually these smells do not crop up right away, rather they accumulate over time as the program evolves (and especially when nobody m refactoring.guru 정의 그룹으로 함께 묶을 수 있는 코드 조각이 있으면, 코드의 목적이 잘 드러나도록 함수의 ..