Replace Conditional with Visitor (by Ivan Mitrovic) <IMG SRC = "http://www.refactoring.com/catalog/new.gif" border=0>
2003. 8. 2. 15:00
Replace Conditional with Visitor
Refactoring contributed by Ivan Mitrovic
You have an "aggressive" Conditional that chooses different behaviour depending on the type of an object and repeats itself in a large number throughout the code.
Create concrete instance of Visitable object for each data type in Conditional. Create concrete instance of Visitor that encapsulates logic of each Conditional. Visit Visitable by Visitor.
More Information
***** 아름다운프로님에 의해서 게시물 복사 + 카테고리변경되었습니다 (2003-12-18 17:27)