Arvind Kumar
Dec 27, 2020

--

What is Reflection and uses of Reflection

Reflection provides objects that describe assemblies, modules, and types. We can dynamically create an instance of a type and bind that type to current object.

Let suppose we have a business class(ArticleLogic) and we have to return News, Expert Review, videos and images of a Car.

Current State of the Code

Now we want to add Road test logic also. so we will add one more else if condition. This code is not extensible, and does not follow the DRY principle because we are repeating similar lines of code.

With Reflection

--

--