Register now or log in to join your professional community.
it is very important to keep code quality high. you can classify this question as a code re-factoring question. the answer is it depends, but mainly you can use strategy pattern and may be you need a method pattern or another creation pattern.
Is it not implementing dynamic polymorphism concept in this scenario.