Introduce Null Object
You have repeated checks for a null value.
Replace the null value with a null object.
if (customer == null) plan = BillingPlan.basic();
else plan = customer.getPlan();
![](http://www.refactoring.com/catalog/arrow.gif)
![](http://www.refactoring.com/catalog/introNullObject.gif)
For more information see page 260 of Refactoring
***** 아름다운프로님에 의해서 게시물 복사 + 카테고리변경되었습니다 (2003-12-18 17:27)