-
객체 간 기능 이동 : Extract Class, Inline ClassProgramming/리팩토링 2020. 9. 5. 19:07
참고자료 https://refactoring.guru/extract-class Extract Class 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 https://refactoring.guru/inline-class Inline Class Tired of reading? No wonder, it takes 7 hours to read all of the text we ha..
-
객체 간 기능 이동 : Move Method, Move FieldProgramming/리팩토링 2020. 9. 5. 18:43
참고자료 https://refactoring.guru/move-method Move 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 https://refactoring.guru/move-field Move Field Tired of reading? No wonder, it takes 7 hours to read all of the text we have here...
-
-
메소드 정리 : Replace Method with Method ObjectProgramming/리팩토링 2020. 9. 4. 16:51
참고자료 https://refactoring.guru/replace-method-with-method-object Replace Method with Method Object 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 정의 함수가 너무 길고 서로 분리하기 어려운 지역 변수의 얽힌 덩어리로 인해 분리 할 수 없을 때, 함수를 별도의 클래스로 선언하여 지역 변수가 클래스..
-
객체 생성 : 추상 팩토리 패턴 ( Abstract Factory Pattern )Programming/패턴 2020. 9. 4. 16:32
GOF의 디자인 패턴 중... 객체 생성의 추상 팩토리에 관한 내용 사용의도 구체적인 자식 클래스를 정의하지 않고 관련성을 갖는 객체들의 집합을 생성하거나 서로 독립적인 객체들의 집합을 생성할 수 있는 인터페이스를 제공하는 패턴. 동기 UI 버튼 모양, 동작 방식이 서로 다르기 떄문에 직접 정의하여 사용하지 않고 인터페이스를 정의한 후, 인터페이스를 상속받은 클래스를 정의하여 구체적인 구현을 제공한다. 활용성 객체가 생성되거나 구성, 표현되는 방식과 무관하게 시스템을 독립적으로 만들고자 할 때 - ( 이해가 잘 안됨.. ) 여러 제품군 중 하나를 선택해서 시스템을 설정해야 하고 한번 구성한 제품을 다른 것으로 대체할 수 있을 때 관련 제품 객체들이 함께 사용되도록 설계되었고 이 부분에 대한 제약이 외부에..
-
메소드 정리 : 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..