-
리팩토링 : Replace Inheritance with Delegation리팩토링 2013. 2. 7. 09:00
조건
서브클래스가 슈퍼클래스 인터페이스의 일부만 사용하거나 상속된 데이터를 사용하지 않는다면
적용
슈퍼클래스를 위한 필드를 생성하고, 슈퍼클래스를 대신하기위한 메소드를 적용하고 서브클래스화를 제거하시오.
참조
http://www.refactoring.com/catalog/replaceInheritanceWithDelegation.html
'리팩토링' 카테고리의 다른 글
리팩토링 : Replace Magic Number with Symbolic Constant (0) 2013.02.09 리팩토링 : Replace Iteration with Recursion (0) 2013.02.08 리팩토링 : Replace Exception with Test (0) 2013.02.06 리팩토링 : Replace Error Code with Exception (0) 2013.02.05 리팩토링 : Replace Delegation with Inheritance (0) 2013.02.04 댓글