Dependency Injection

Dependency injection removes the responsibility for object creation and object linking from the objects themselves to a factory.(依赖注入把创建对象和链接对象的职责从对象移除到工厂。) The factory is often provided by an Inversion of Control (IoC) container.(这个工厂一般是由反向控制容器提供) For an overview of Inversion of Control containers and the Dependency Injection pattern, please see Martin Fowler's article.(为了对反向控制容器和依赖注入模式有一个大概的了解,请看Martin Fowler的文章。)
 
Internally, the framework uses its own dependency injection container that is very similar to Google Guice. (内部,这个框架使用它自己的依赖注入容器,它跟谷歌的Guice非常地类似。)Both were originally developed by Bob Lee.(两个最开始都是Bob Lee开发的) Plugins are available to integrate applications with other IoC containers (e.g. Spring Plugin, Plexus Plugin)(插件是允许使用其他的IOC容器比如Spring Plugin, Plexus Plugin来整合应用程序。). An application can even use a local copy of Google Guice for dependency injection needs.(应用程序甚至可以使用谷歌的本地复制版本来提供注入需要。)
 Actions can still be instantiated via Spring configuration by way of the Spring Plugin, but Spring is entirely optional.(Action写在spring的配置文件中经由Spring插件初始化,但Spring是完全可选的。)
 
 The WebWork/XWork IoC container utilized by WebWork 2.1 is not supported by Struts 2.(WebWork 2.1使用的WebWork/XWork IoC容器在struts2中没有提供。)

你可能感兴趣的:(文档,truts)