emotional developer/detect-pattern
Refactor if/elseif/elseif
성게군.
2023. 5. 4. 03:08
반응형
Refactor if/elseif/elseif using Strategy Design Pattern
Strategy Design pattern enables an algorithm’s behavior to be selected at runtime. The pattern
medium.com
Pros :
1. Adding a new strategy will never disturb any previous code.
2. Removal/Refactoring of any previous strategy is flexible.
3. Easy to test single units.
실제 업무에서는 어떤 선택을 할지 고민..
반응형