计算机技术与发展
計算機技術與髮展
계산궤기술여발전
COMPUTER TECHNOLOGY AND DEVELOPMENT
2006年
9期
38-40
,共3页
控制反转%依赖注入%组件%Struts框架
控製反轉%依賴註入%組件%Struts框架
공제반전%의뢰주입%조건%Struts광가
为了解决使用标准Struts框架开发程序时所带来的组件之间的耦合程度比较高的缺点,在标准Struts框架中引入了Dependency Injection(DI)模式.在介绍了DI模式的基本原理和3种实现类型之后,基于该模式对标准的Struts1.2框架进行了扩展,主要加入了设值方法注入功能.扩展框架实现了对Action Form Bean、数据库连接和一般对象的注入.在实际项目中基于此扩展框架进行了软件开发,发现该框架降低了系统的组件之间的耦合,简化了对单个组件的单元测试,效果非常明显.
為瞭解決使用標準Struts框架開髮程序時所帶來的組件之間的耦閤程度比較高的缺點,在標準Struts框架中引入瞭Dependency Injection(DI)模式.在介紹瞭DI模式的基本原理和3種實現類型之後,基于該模式對標準的Struts1.2框架進行瞭擴展,主要加入瞭設值方法註入功能.擴展框架實現瞭對Action Form Bean、數據庫連接和一般對象的註入.在實際項目中基于此擴展框架進行瞭軟件開髮,髮現該框架降低瞭繫統的組件之間的耦閤,簡化瞭對單箇組件的單元測試,效果非常明顯.
위료해결사용표준Struts광가개발정서시소대래적조건지간적우합정도비교고적결점,재표준Struts광가중인입료Dependency Injection(DI)모식.재개소료DI모식적기본원리화3충실현류형지후,기우해모식대표준적Struts1.2광가진행료확전,주요가입료설치방법주입공능.확전광가실현료대Action Form Bean、수거고련접화일반대상적주입.재실제항목중기우차확전광가진행료연건개발,발현해광가강저료계통적조건지간적우합,간화료대단개조건적단원측시,효과비상명현.