Remove Setting Method <IMG SRC = "http://www.refactoring.com/catalog/updated.gif" border=0>
2003. 8. 2. 14:47
Remove Setting Method
Remove any setting method for that field.
![](http://www.refactoring.com/catalog/removeSettingMethod.gif)
For more information see page 300 of Refactoring
Corrections
Using Final
Paul Haahr kindly pointed out to me that I've not been accurate with the use of
final
in this refactoring. The point that I missed is that you can't use a final field if the initialization is done in a separate method to the constructor. This the example at the bottom of page 301 (that uses initialize(id)
) just does not compile. (My apologies for not testing that fragment, some do slip through the net....) If you want to use a separate method, you can't make the field finalThis also means that the mechanics is incorrect. Making the field final should be the last step not the first, and can only be done if it's possible.
Contributors
- Paul Haahr
***** 아름다운프로님에 의해서 게시물 복사 + 카테고리변경되었습니다 (2003-12-18 17:27)