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

基于DI模式对Struts框架的扩展研究
引用本文:戚荣志,王志坚.基于DI模式对Struts框架的扩展研究[J].微机发展,2006,16(9):38-40.
作者姓名:戚荣志  王志坚
作者单位:河海大学计算机及信息工程学院 江苏南京210098
摘    要:为了解决使用标准Struts框架开发程序时所带来的组件之间的耦合程度比较高的缺点,在标准Struts框架中引入了Dependency Injection(DI)模式。在介绍了DI模式的基本原理和3种实现类型之后,基于该模式对标准的Struts1.2框架进行了扩展,主要加入了设值方法注入功能。扩展框架实现了对ActionForm Bean、数据库连接和一般对象的注入。在实际项目中基于此扩展框架进行了软件开发,发现该框架降低了系统的组件之间的耦合,简化了对单个组件的单元测试,效果非常明显。

关 键 词:控制反转  依赖注入  组件  Struts框架
文章编号:1673-629X(2006)09-0038-03
修稿时间:2005年12月18

Research on Extension of Struts Framework Based on DI Pattern
QI Rong-zhi,WANG Zhi-jian.Research on Extension of Struts Framework Based on DI Pattern[J].Microcomputer Development,2006,16(9):38-40.
Authors:QI Rong-zhi  WANG Zhi-jian
Abstract:In order to solve the shortcoming of the higer coupling between the components while developing with the standard Struts framework,the article intorduces the Dependency Injection(DI) pattern in it.This paper makes a detailed introduction on the basic principle of the DI pattern and its three types of implementation, and extends the standard Struts 1.2 framework by adding the setter injection.The extended framework implements the function of injecting ActionFrom Bean,database connection and general objects.This extended framework has been used to develop a software project.During the development,have found that this framework reduced the coupling between the components of the system greatly,simplified the unit test of the individual component.The result is very obvious.
Keywords:inversion of control  dependency injection  component  Struts framework
本文献已被 CNKI 等数据库收录!
设为首页 | 免责声明 | 关于勤云 | 加入收藏

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