期刊文献+

基于DI模式对Struts框架的扩展研究

Research on Extension of Struts Framework Based on DI Pattern
下载PDF
导出
摘要 为了解决使用标准Struts框架开发程序时所带来的组件之间的耦合程度比较高的缺点,在标准Struts框架中引入了Dependency Injection(DI)模式。在介绍了DI模式的基本原理和3种实现类型之后,基于该模式对标准的Struts1.2框架进行了扩展,主要加入了设值方法注入功能。扩展框架实现了对ActionForm Bean、数据库连接和一般对象的注入。在实际项目中基于此扩展框架进行了软件开发,发现该框架降低了系统的组件之间的耦合,简化了对单个组件的单元测试,效果非常明显。 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.
出处 《计算机技术与发展》 2006年第9期38-40,共3页 Computer Technology and Development
关键词 控制反转 依赖注入 组件 STRUTS框架 inversion of control dependency injection component Struts framework
  • 相关文献

参考文献5

  • 1Johnson R.The Spring Framework[EB/OL].http://www.springframework.org/.2005-06-15. 被引量:1
  • 2Pico Container Organization.The Pico Container Home Page[EB/OL].http://www.picocontainer.org/.2005-06-25. 被引量:1
  • 3Fowler M.Inversion of Control Containers and the Dependency Injection pattern[EB/OL].http://martinfowler.com/articles/mjection.html,2004-01-23. 被引量:1
  • 4The Apache Software Foundation.The Struts project[EB/OL].http://struts.apache.org/.2005-06-10. 被引量:1
  • 5孙卫琴编著..精通Struts:基于MVC的Java Web设计与开发[M].北京:电子工业出版社,2004:496.

相关作者

内容加载中请稍等...

相关机构

内容加载中请稍等...

相关主题

内容加载中请稍等...

浏览历史

内容加载中请稍等...
;
使用帮助 返回顶部