Why is the use of reflection in .NET recommended?

后端 未结 9 650
再見小時候
再見小時候 2020-11-30 22:25

Is it definitely a good practice to use it?

What are some possible situations in a project that need reflection?

9条回答
  •  时光取名叫无心
    2020-11-30 23:08

    You can use reflection to implement a system of plugins for example. You just look for all DLL's in a folder and through reflection check if they implement a certain plugin interface. This is the main purpose for which I used reflection, but I also used it to implement a generic home-brew object serialization, where performance was not the greatest concern.

提交回复
热议问题