首页 | 本学科首页   官方微博 | 高级检索  
     

论spring的零配置与XML配置
引用本文:张文宇,许明健,薛昱.论spring的零配置与XML配置[J].计算机系统应用,2015,24(2):270-275.
作者姓名:张文宇  许明健  薛昱
作者单位:1. 西安邮电大学 经济与管理学院,西安,710061
2. 北京信息控制研究所,北京,100089
基金项目:陕西省自然科学基金(2012GQ8050)
摘    要:从多方面比较了Spring框架的XML配置和零配置方式的好处与不足,总结在实际开发中应如何灵活使用两种配置方式,以提高项目开发的效率.首先分别介绍了Spring框架的XML配置和零配置,其次举例说明了如何通过XML配置和零配置实现Spring的依赖注入功能,然后从Spring框架的骨骼架构和设计理念方面分析了XML配置相对零配置的优势.实践结果表明,在实际应用的开发期间应采用零配置方式,而在开发后期,项目功能完成时,应将零配置转换为XML配置,禁用零配置,从而显著提高项目开发的效率.

关 键 词:Spring  XML  零配置  依赖注入  控制反转件
收稿时间:2014/6/17 0:00:00
修稿时间:9/9/2014 12:00:00 AM

Introduction to Spring Zero Configurationand XML Configurationand
ZHANG Wen-Yu,XU Ming-Jian and XUE Yu.Introduction to Spring Zero Configurationand XML Configurationand[J].Computer Systems& Applications,2015,24(2):270-275.
Authors:ZHANG Wen-Yu  XU Ming-Jian and XUE Yu
Affiliation:College of Economic and Management, Xian University of Posts and Telecommunications, Xian 710061, China;College of Economic and Management, Xian University of Posts and Telecommunications, Xian 710061, China;Beijing Institute of Information Control, Beijing 100089, China
Abstract:The benefits and shortcomings of XML configuration and zero configuration of the Spring Framework is compared from several aspects. How to use two configurations flexible in the actual development is summarized to improve the efficiency of project development. Firstly, XML configuration and zero configuration of the Spring Framework is introduced. Secondly, how to implement dependency injection of the Spring Framework is illustrated through XML configuration and zero configuration. Then, the relative advantages of XML configuration to zero-configuration is analyzed from bone architecture and design aspects of the Spring framework. Practice results show that the zero configuration should be used during the development of practical application. And late in the development, when the function of the project is completed, zero configuration should be converted to XML configuration, disable zero configuration. Thus, the efficiency of project development will be improved significantly.
Keywords:Spring  XML  zero-configuration  dependency injection  inversion of control
本文献已被 CNKI 万方数据 等数据库收录!
点击此处可从《计算机系统应用》浏览原始摘要信息
点击此处可从《计算机系统应用》下载全文
设为首页 | 免责声明 | 关于勤云 | 加入收藏

Copyright©北京勤云科技发展有限公司  京ICP备09084417号