关于IOC和DI讨论

刚刚看了 spring3最新最全的免费PPT下载,第一手拿到的内部资料,分享给各位 这篇帖子中的PPT,在PPT中 把 IOC和DI详细的讲解了一个遍,不知道为什么,我是看着这个讲解越看越觉得越让人迷惑。且看下图



 这是直接截取的PPT的内容,我真不知道这样来描述这所谓的2个概念需要让看客们如何理解...

 

同时我们可以去看看 Martin Fowler的   Inversion of Control Containers and the Dependency Injection pattern  

或者中文版本:http://simplejee.googlecode.com/files/DependencyInjection.pdf

 

在这个文章中如果说我没有理解错误的话,作者很清楚的描述了IOC和DI在他们支撑着的是都实现了相同的一个模式,而这个模式决定了使用的容器组件装配的方式。

“In the Java community there's been a rush of lightweight containers that help to assemble components from different projects into a cohesive application. Underlying these containers is a common pattern to how they perform the wiring, a concept they refer under the very generic name of "Inversion of Control". In this article I dig into how this pattern works, under the more specific name of "Dependency Injection", and contrast it with the Service Locator alternative. The choice between them is less important than the principle of separating configuration from use.”

 

但但这个PPT里所描述的这二者如果按正常的理解的话和这篇文章的描述应该是有出入的吧....

 

 

欢迎大家扔砖头.

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值