Java中的语言反射
Linguistic Reflection in Java
摘要:
反射系统允许从内部改变其自身的结构。在这里,我们关注的是一种反射风格,称为语言反射,这是一个运行的程序生成新的程序片段,并将这些整合到自己的执行能力。特别是,我们描述了这种反射可以提供基于编译器的,强类型的面向对象的程序设计语言Java。这种编程技术的优点包括获得高级别的泛型和适应系统演化。这些优点说明了持久性编程的一个例子,它显示了语言反射如何允许功能(程序代码)生成的需求(即时)从一个通用的规范和集成到不断发展的运行程序。该技术的评价对替代实施方法的效率,安全性和易用性。
英文摘要:
Reflective systems allow their own structures to be altered from within. Here we are concerned with a style of reflection, called linguistic reflection, which is the ability of a running program to generate new program fragments and to integrate these into its own execution. In particular we describe how this kind of reflection may be provided in the compiler-based, strongly typed object-oriented programming language Java. The advantages of the programming technique include attaining high levels of genericity and accommodating system evolution. These advantages are illustrated by an example taken from persistent programming which shows how linguistic reflection allows functionality (program code) to be generated on demand (Just-In-Time) from a generic specification and integrated into the evolving running program. The technique is evaluated against alternative implementation approaches with respect to efficiency, safety and ease of use.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。