转自:http://www.picocontainer.org/One+minute+description
One minute description
一分钟描述
Authors: Paul Hammant, Aslak Hellesoy, Jon Tirsen
What is PicoContainer?
什么是微容器?
PicoContainer is a lightweight container.
微容器是一个轻量级容器
It is not a replacement for a J2EE container, as it doesn't offer any infrastructure services out of the box.
它不是J2EE容器的替代者,因此它不能脱离基础框架提供任何基础服务.(这里的box就我现在的理解为基础框架,如果有错误还请帮忙指点谢谢)
It can help you write better code.
它可以帮助你写出更完善的代码.
What does PicoContainer do?
微容器可以做什么?
Dependency Injection. A way of instantiating components and lacing them together with other dependent components.
依赖性注射模式.一种可以初始化组件并将与之相关的组件拼装到一起的方法.
PicoContainer is non-intrusive. Components don't have to implement any funny APIs. They can be POJOs.
微容器是非插入式的.组件不需要实现任何特殊的API,它们完全可以是简单的java对象(POJOs).
Lifecycle support is built-in. Components' lifecycle can be managed easily by PicoContainer. (The default lifecycle is simple, but can be extended.)
微容器整合了生命周期管理,可以方便的管理组件的生命周期.(默认的生命周期管理功能非常简单,但它是可以扩展的)
Very extensible design enabling virtually any form of extensions to the core.
灵活的设计允许核心功能进行任何形式的扩展.
It is embeddable inside other applications. A 50k jar that has no external dependencies except JDK 1.3.
他可以嵌入到其他应用服务的内部.除了JDK1.3外,他可以仅仅50K而不需要任何外部类库.
How do I use PicoContainer?
我如何使用微容器?
Components are implemented as ordinary Java classes and do typically not have to rely on any PicoContainer APIs.
组件的实现完全可以是基本的java类并且不需要依靠任何微容器的API.
The components are assembled in the container using a simple Java API that is similar to a hash map.
在微容器中,使用java的hash map来装配组件.
If lifecycle callbacks are required the simple lifecycle interfaces can be implemented. If you prefer to use your own lifecycle interfaces you can do that (but remember that third party components might rely on the default lifecycle).
如果需要生命周期管理可以使用容器自带的接口来实现.如果你需要使用自己的生命周期管理也可以实现自己的接口(但是要注意的是第三方的组件也许依靠默认的生命周期管理方式).
Why should I use PicoContainer?
我为什么要使用微容器?
To modularize how dependencies between parts of your application are laced up. It is common having this scattered all over.
模块化,使相关联的组件联系到一起.一般情况下他们会是分散在你的应用系统中的.
To improve the testability of your code.
提高你的代码的可测试性.
To improve how components are configured in application.
体好你的组件的可配置性.
Next: Two minute tutorial
下一步:两分钟教程
本文地址:http://com.8s8s.com/it/it11349.htm