基于反射机制的框架研究与实现本科生毕业(设计)论文.doc
文本预览下载声明
基于反射机制的框架研究与实现
RESEARCH AND IMPLEMENTATION OF THE FRAMEWORK BASED ON REFLECTION
专 业: 2010信息与计算科学 指导教师姓名: 申请学位级别: 学士 论文提交日期: 2014年6月12日
摘 要
目前,随着互联网应用的快速发展,软件运行环境正从一个集中封闭计算的平台走向开放、动态的计算平台,并且基于服务的计算模式将逐渐取代它,因此这些变化传统软构件技术应对起来很困难。本文针对目前框架复用程度不高,无法适应动态运行环境和多变用户需求这些问题,基于反射理论,研究具有灵活性和自适应性的框架。框架具有减少代码冗余,提高运行速度,便于维护,规范编程等优点。
Java反射机制是在运行状态当中,对于任何一个类,都可以知道这个类的所有属性及方法;对于任何一个对象,都能够调用它的一个方法及属性;这种动态获取信息和动态调用对象方法的功能称为Java语言的反射机制。反射其实就是程序可以对自身信息进行检查。在程序中能够检查某类中的方法属性等信息,而且能够动态调用。这样就能够写出很灵活的程序。例如想要把一个对象中属性名相同的数据复制到另外一个对象中,就可以利用反射,而且不需要指定每个属性名字,只需要动态从类中获取信息,再判断属性名是否相同就可以了。
本课题旨在基于反射机制对框架进行研究,实现一个轻量级的框架以此来适应小的系统。轻量J2EE应用是对经典J2EE 应用的简化,在保留经典 J2EE应用的架构、良好的可扩展性、可维护性的基础上,简化了J2EE应用的开发,降低了J2EE应用的成本。
关键词:反射机制;轻量级;框架
ABSTRACT
Currently, with the rapid development of Internet applications, software operating environment is moving from a centralized closed computing platform to an open and dynamic computing platform, service-based computing model will gradually replace it, therefore, these changes traditional software component technology is very difficult to deal with. In this article, For these issues about current software component repeated utilization is not high, dynamic operating environment cannot meet and the changing needs of users, according to the theory of reflection, this article researches a software component technology which is high flexibility and adaptability. The framework is with the advantages of reducing code redundancy, improving the speed, ease of maintenance, standardized programming and so on.
JAVA reflection can know all the properties and methods of any one class in running them; For any object, it is able to call one of its methods and properties; The function of accessing to information dynamically and calling object method dynamically is called reflection mechanism of java language. Actually, reflection is a program can check the information on their own. JAVA reflection mechanism can check the properties of certain methods in information, and invoke dy
显示全部