读书人

Spring 三 Dependency injection

发布时间: 2012-11-23 22:54:33 作者: rapoo

Spring 3 Dependency injection

    The ApplicationContext is created and initialized with configuration metadata that describes all the beans. Configuration metadata can be specified via XML, Java code or annotations.

    For each bean, its dependencies are expressed in the form of properties, constructor arguments, or arguments to the static-factory method if you are using that instead of a normal constructor. These dependencies are provided to the bean,when the bean is actually created.

    Each property or constructor argument is an actual definition of the value to set, or a reference to another bean in the container.

    Each property or constructor argument which is a value is converted from its specified format to the actual type of that property or constructor argument. By default Spring can convert a value supplied in string format to all built-in types, such asint, long, String, boolean, etc.


读书人网 >其他相关

热点推荐