Replace groups of data items that regularly travel together with a single data structure
(산재 되어있는 데이터 항목들을 하나의 데이터 객체로 구조화)
function amountInvoiced(startDate, endDate) {}
function amountReceived(startDate, endDate) {}
function amountOverdue(startDate, endDate) {}
to
function amountInvoiced(aDateRange) {}
function amountReceived(aDateRange) {}
function amountOverdue(aDateRange) {}
If there is no appropriate data structure, make new one.
적당한 데이터 구조가 아직 마련되어 있지 않다면 새로 만든다.
Test it.
테스트한다.
Add the new data structure with function name change
함수 선언 바꾸기로 새 데이터 구조를 매개변수로 추가한다.
Test it.
테스트
Modify to pass a new data structure instance when calling a function. Test every modification.
함수 호출 시 새로운 데이터 구조 인스턴스를 넘기도록 수정한다. 하나씩 수정할 때마다 테스트한다.
Replace previous parameters to new data structrue one.
기존 매개변수를 사용하던 코드를 새 데이터 구조의 원소를 사용하도록 바꾼다.
If you finish to replace, remove previous parameters and test them.
다 바꿨다면 기존 매개변수를 제거하고 테스트한다.