Saturday 20 June 2015

Reflection at rescue

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.

Basics of Tree data structure

Tree data structure simulates a  hierarchical tree structure, with root and subtrees represented by linked nodes. Some Terminology Root...