摘要
从多方面比较了Spring框架的XML配置和零配置方式的好处与不足,总结在实际开发中应如何灵活使用两种配置方式,以提高项目开发的效率.首先分别介绍了Spring框架的XML配置和零配置,其次举例说明了如何通过XML配置和零配置实现Spring的依赖注入功能,然后从Spring框架的骨骼架构和设计理念方面分析了XML配置相对零配置的优势.实践结果表明,在实际应用的开发期间应采用零配置方式,而在开发后期,项目功能完成时,应将零配置转换为XML配置,禁用零配置,从而显著提高项目开发的效率.
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.
出处
《计算机系统应用》
2015年第2期270-275,共6页
Computer Systems & Applications
基金
陕西省自然科学基金(2012GQ8050)