-
메소드 정리 : 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 정의 그룹으로 함께 묶을 수 있는 코드 조각이 있으면, 코드의 목적이 잘 드러나도록 함수의 ..
-
정규화 : BCNF 정규형IT Tech/DB 2020. 8. 28. 12:28
정규화 데이터베이스의 이상현상의 원인이 되는 데이터의 중복성을 방지하기 위해 무결성을 보존하는 기법 BCNF 정규화 3차 정규형을을 만족하고 릴레이션 R이 함수 종속성 X->Y가 성립할 때 모든 결정자가 X가 후보키이면 BCNF 정규형이라고 한다. 특강수강 학생번호 특강이름 교수 501 소셜네트워크 김교수 401 소셜네트워크 김교수 402 인간과동물 김교수 502 창업전략 박교수 501 창업전략 홍교수 { 학생번호, 특강이름 } 이 후보키가 된다. 여기서 { 교수 } 는 { 특강이름 } 에 종속하게 된다. 정규화를 진행한다. 특강신청 학생번호 교수 501 김교수 401 김교수 402 승교수 502 박교수 501 홍교수 특강교수 특강이름 교수 소셜네트워크 김교수 인간과 동물 승교수 창업전략 박교수 창업전략..
-
정규화 : 제3 정규형(3NF)IT Tech/DB 2020. 8. 28. 01:42
정규화 데이터베이스의 이상현상의 원인이 되는 데이터 중복성을 제거하여 무결성을 보존하는 것. 제3 정규형 릴레이션 R이 제2 정규형이고, 기본키가 아닌 속성이 기본키에 비이행적 non-transitive 으로 종속할 때 (직접 종속) 제3 정규형이라고 한다. 다른 말로 이행적 함수 종속을 제거하면 된다. A->B, B->C 가 성립되는 함수 종속성을 말한다. 계절학기 학생번호 강좌이름 수강료 501 데이터베이스 20,000 401 데이터베이스 20,000 402 스포츠경영학 15,000 502 자료구조 25,000 이 릴레이션을 보면 { 학생번호 } -> { 강좌이름 } { 강좌이름 } -> { 수강료 } { 학생번호 } -> { 수강료 } 로 이행적인 종속성을 띈다. 이행적인 종속성을 없애기 위해 { ..