Java_PicoContainer

Inversion of Control is three things: component dependencies and configuration, but also Component Lifecycle

(一)       PicoContainer's Architecture

1)       Design Patterns(设计原则)

2)       Inversion of ControlMartin fowler03

3)       Component Adapters()

ComponentAdapters are probably PicoContainer's most highly misunderstood (and coincidentally, most powerful) feature. They combine the power of an object factory, and an object interceptor rolled into one.

4个功能:

第一:Instantiation and Injectors,即如何注入并创建;

第二:Post Instantiation Modification using Behaviors;

第三:Changing the default ComponentAdapter for a new PicoContainer

第四:Changing the default ComponentAdapter when registering objects.

4)       Mock Objects(测试)

5)       Terminology(术语)

6)       Container Comparisons

Spring/EJB/Servlets/Applets

7)       Transparency

(二)       Container Choices(容器选择)

1)       DefaultPicoContainer

Parameters in its constructors can be:

Ø  Behavior Factories or Component Factories(已经实验过)

Ø  Lifecycle Strategies(已经实验过,但还是不清楚)

Ø  Component Monitors(还没有实验过)

Ø  Parent Containers of various types(已经实验过,容器结构等)

2)       CommandLinePicoContainer(从命名行接口参数的封装)

3)       PropertiesPicoContainer(从 properties file加载参数)

4)       SystemPropertiesPicoContainer(从System Properties

5)       TransientPicoContainer(暂时存在,de-referenced shortly after use

6)       TieringPicoContainer is the same as DefaultPicoContainer, except that child containers can only seek to locate unsatisfied injection dependencies for their immediate parent container. Their grandparents are out of bounds for dependency resolution.

(三)       Scoped Containers(容器关系)

PicoContainer's scope hinges on parent/child container relationships. From a PicoContainer instance you can make a child container via makeChildContainer() or addChildContainer(..).

(四)       Advanced Concepts

1.       Fluent Style

http://www.martinfowler.com/bliki/FluentInterface.html

 

(五)       Specific Behaviors特性

1.       缓存:(基本缓存,线程缓存,存储Session/Storing<HttpSession, ThreadLocal>
2.       Implementation Hiding(即不能根据具体类型获取实现,Hot Swapping)
3.       Thread Safety(同步/)

pico = new DefaultPicoContainer(new Synchronizing().wrap(new Caching()));

pico = new DefaultPicoContainer(new Locking().wrap(new Caching()));

(更有效)

4.       InterceptionAOP/侵入性还是强)
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值