在本文中,我讲述了一个用于处理命令行参数的库的设计过程,作为反射的一个实际的例子。
In this article, I've run through the design of a library for processing command line arguments as an example of reflection in action.
我不打算一一介绍每一个类,因为其中大部分类都与库的反射方面不相关。
I'm not going to go through the whole list here, since most are irrelevant to the reflection aspect of the library.
反射将使得应用程序可以直接访问这些私有字段,允许参数处理库在应用程序代码中没有任何特殊钩子的情况下设置参数的值。
Reflection will give direct access to these private fields, allowing the argument processing library to set values without any special hooks in the application code.
应用推荐