阐述了复杂界面的数据显示与数据采集存在的问题,提出用反射技术解决这类问题的原理和算法。通过对反射及基于反射的数据交换原理的分析,以及对包括文本框、单选、多选、下拉列表等复杂界面元素与数据对象之间的自动数据交换的原理和方法的详细讨论,设计了界面元素与数据对象之间的数据交换算法。实践表明,基于反射的数据交换技术极大地减少了复杂界面元素与数据对象之间的数据交换的代码量,减少了代码错误,提高了系统的正确性和稳定性。
The difficulties of data display and acquisition of complex user interface are expounded, and the reflection based princi ple and algorithms which solve these difficulties are put forward. By analyzing the principles of reflection and reflection based da ta interchange, and discussing on data interchange between complex display elements (such as text box, radio box, check box, list box) and data object, the corresponding algorithms are designed too. Practice proves that the reflection based data inter change technology reduces the code lines and errors dramatically, enhances the program correctness and stability greatly.