-
참고자료
https://refactoring.guru/change-value-to-reference
Change Value to Reference
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/change-reference-to-value
Change Reference to Value
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
Change Value to Reference 정의
동일한 인스턴스를 여러 개 가지고 있는 클래스가 있고 여러 개의 동일한 인스턴스를 하나의 객체로 바꾸고 싶으면, 그 객체를 참조 객체로 바꾸는 기법.
기존 예시
리팩토링 예시
Change Reference to Value 정의
불변성을 띄고, 관리하기가 어려운 참고 객체가 있는 경우, 그것을 값 객체로 바꾼다.
기존 예시
리팩토리 예시
반응형'Programming > 리팩토링' 카테고리의 다른 글
데이터 구성 : Replace Array with Object (0) 2020.09.10 데이터 구성 : Replace Data Value with Object (0) 2020.09.07 데이터 구성 : Self Encapsulate Field (0) 2020.09.06 객체 간 기능 이동 : Introduce Foreign Method, Introduce Local Extension (0) 2020.09.06 객체 간 기능 이동 : Extract Class, Inline Class (0) 2020.09.05