Few days back , i found some codebase which handled so many if conditions based on some input parameter. This thing made particular method to be 100 lines long. The code works fine , but was too ugly.
The situation was like this.
Using reflection it can done in some few lines.
So you can see here , that this particular piece of code is more maintainable , no matter how many more properties or types you add , it just works.
The situation was like this.
Using reflection it can done in some few lines.
So you can see here , that this particular piece of code is more maintainable , no matter how many more properties or types you add , it just works.