Self Encapsulate Field
Create getting and setting methods for the field and use only those to access the field.
private int _low, _high;
boolean includes (int arg) {
return arg >= _low && arg <= _high;
}
![](http://www.refactoring.com/catalog/arrow.gif)
private int _low, _high;
boolean includes (int arg) {
return arg >= getLow() && arg <= getHigh();
}
int getLow() {return _low;}
int getHigh() {return _high;}
For more information see page 171 of Refactoring
***** 아름다운프로님에 의해서 게시물 복사 + 카테고리변경되었습니다 (2003-12-18 17:27)