首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 其他教程 > 其他相关 >

Spring 三 Dependency injection

2012-11-23 
Spring 3 Dependency injectionThe ApplicationContext is created and initialized with configuration m

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.


热点排行