JavaScud | Forum | JIRA | Blog |
  Dashboard > WebWork2文档中文化计划 > WebWork > Inversion of Control
  WebWork2文档中文化计划 Log In View a printable version of the current page.  
  Inversion of Control
Added by scud, last edited by scud on Apr 25, 2006  (view change)
Labels: 
(None)

什么是控制反转 (IoC)?

控制反转是用来处理对象间的依赖关系. 为了了解控制反转(现在也称为依赖注入Dependency Injection), 请阅读 Martin Fowler关于IoC的文档.

推荐的IoC容器是Spring

伴随着其他特性,Spring同时也是IoC框架的一种. 在WebWork 2.2中, 它是被推荐使用的IoC容器. 一篇详细的描述如何集成Spring到WebWork中的文章请阅读 这里.
除了Spring以外, 还有许多其他容器可以使用, 比如Pico 和 (不赞成使用XWork的IoC容器)集成在XWork 中的IoC容器.

WebWork/XWork 集成的IoC容器

在WebWork 2.2中, WebWork/XWork IoC 容器是不赞成使用的(虽然没有移除), WebWork 开发组推荐使用Spring 作为你的IoC 容器

在WebWork Ioc中,拥有被管理的依赖(对象)的对象叫做"组件(component)".

Components (WebWork2文档中文化计划)
IoC Configuration (WebWork2文档中文化计划)
IoC Overview (WebWork2文档中文化计划)
Xwork's Component Architecture (WebWork2文档中文化计划)
Site running on a free Atlassian Confluence Open Source Project License granted to WebWork China. Evaluate Confluence today.
Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.5.3 Build:#808 May 29, 2007) - Bug/feature request - Contact Administrators