Spring Framework: Difference between revisions

Content deleted Content added
Tags: Mobile edit Mobile web edit
Line 88:
Objects created by the container are called managed objects or [[JavaBeans|beans]].{{sfn | Deinum | Long | Mak | Rubio | 2014 | loc=§2-16 Use Property Editors in Spring|pp=112-116}} The container can be configured by loading [[XML]] (Extensible Markup Language) files{{sfn | Deinum | Long | Mak | Rubio | 2014 | loc=§2-1 Manage and Configure POJOs with the Spring IoC Container | pp=48-52}}{{sfn | Johnson | Hoeller | 2004}}{{rp|pp=151–152}} or detecting specific [[Java annotation]]s on configuration classes. These data sources contain the bean definitions that provide the information required to create the beans.
 
The {{code|@Configuration}} is a Spring-specific annotation that marks a class as the configuration class. The configuration class provides the beans to the Spring {{code|ApplicationContext}}.{{sfn|Walls|2019|loc=§1.1 Getting started with Spring - What is Spring|pp=4-6}} Each of the methods in the Spring configuration class is configured with the {{code|@Bean}} annotation. The {{code|ApplicationContext}} interface will then return the objects configured with the {{code|@Bean}} annotation as beans. The advantage of javaJava-based configuration over XML-based configuration is better type safety and refactorability.{{sfn|Walls|2019|loc=§1.1 Getting started with Spring - What is Spring | pp=4-6}}
 
==== Types of Inversion of Control ====