(중간자 삭제)
Client call the delegate directly
(클라이언트가 위임을 바로 호출하게 한다.)
manager = aPerson.manager
class Person {
get manager() {
return this.department.manager
}
}
to
manager = aPerson.department.manager
Make the getter which get the delegation object.
위임 객체를 얻는 게터를 만든다.
Modify all clients calling the delegation method to go through this getter. Test each time you change one by one.
위임 메소드를 호출하는 클라이언트가 모두 이 게터를 거치도록 수정한다. 하나씩 바꿀 때마다 테스트한다.
If you modify all, remove the delegation method
모두 수정했다면 위임 메소드를 삭제한다.