|
35 | 35 | import org.springframework.util.Assert;
|
36 | 36 |
|
37 | 37 | /**
|
38 |
| - * A root bean definition represents the merged bean definition that backs |
39 |
| - * a specific bean in a Spring BeanFactory at runtime. It might have been created |
40 |
| - * from multiple original bean definitions that inherit from each other, |
41 |
| - * typically registered as {@link GenericBeanDefinition GenericBeanDefinitions}. |
| 38 | + * A root bean definition represents the <b>merged bean definition at runtime</b> |
| 39 | + * that backs a specific bean in a Spring BeanFactory. It might have been created |
| 40 | + * from multiple original bean definitions that inherit from each other, e.g. |
| 41 | + * {@link GenericBeanDefinition GenericBeanDefinitions} from XML declarations. |
42 | 42 | * A root bean definition is essentially the 'unified' bean definition view at runtime.
|
43 | 43 | *
|
44 |
| - * <p>Root bean definitions may also be used for registering individual bean definitions |
45 |
| - * in the configuration phase. However, since Spring 2.5, the preferred way to register |
46 |
| - * bean definitions programmatically is the {@link GenericBeanDefinition} class. |
47 |
| - * GenericBeanDefinition has the advantage that it allows to dynamically define |
48 |
| - * parent dependencies, not 'hard-coding' the role as a root bean definition. |
| 44 | + * <p>Root bean definitions may also be used for <b>registering individual bean |
| 45 | + * definitions in the configuration phase.</b> This is particularly applicable for |
| 46 | + * programmatic definitions derived from factory methods (e.g. {@code @Bean} methods) |
| 47 | + * and instance suppliers (e.g. lambda expressions) which come with extra type metadata |
| 48 | + * (see {@link #setTargetType(ResolvableType)}/{@link #setResolvedFactoryMethod(Method)}). |
| 49 | + * |
| 50 | + * <p>Note: The preferred choice for bean definitions derived from declarative sources |
| 51 | + * (e.g. XML definitions) is the flexible {@link GenericBeanDefinition} variant. |
| 52 | + * GenericBeanDefinition comes with the advantage that it allows for dynamically |
| 53 | + * defining parent dependencies, not 'hard-coding' the role as a root bean definition, |
| 54 | + * even supporting parent relationship changes in the bean post-processor phase. |
49 | 55 | *
|
50 | 56 | * @author Rod Johnson
|
51 | 57 | * @author Juergen Hoeller
|
|
0 commit comments