Inline Method
A method's body is just as clear as its name.
Put the method's body into the body of its callers and remove the method.
int getRating() {
return (moreThanFiveLateDeliveries()) ? 2 : 1;
}
boolean moreThanFiveLateDeliveries() {
return _numberOfLateDeliveries > 5;
}
![](http://www.refactoring.com/catalog/arrow.gif)
int getRating() {
return (_numberOfLateDeliveries > 5) ? 2 : 1;
}
For more information see page 117 of Refactoring
***** 아름다운프로님에 의해서 게시물 복사 + 카테고리변경되었습니다 (2003-12-18 17:27)