When do you use reflection? Patterns/anti-patterns

前端 未结 17 2203
旧时难觅i
旧时难觅i 2020-12-02 09:58

I understand the reflection API (in c#) but I am not sure in what situation would I use it. What are some patterns - anti-patterns for using reflection?

17条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-02 10:49

    I went for 2 years of development without understanding the purpose of reflection. It has very niche uses, but is extremely powerful when it is the right tool for the job.

    I think what I'm trying to say is only use it when you are sure it's the only way to achieve what you want.

提交回复
热议问题