Tuesday, September 7, 2021

what 3 things need to tell spring ?

 1.what are the bean:-we annotate classes with @Component to specify our bean.

2.What are the dependencies of a bean:-We can annotate with @Autowired to specify dependencies.

3.Where to search for bean:-That means in which package beans are available .

we can specify through @ComponentScan annotation.

In spring boot @SpringBootApplication annotation automatically scan for beans in the package and sub-packages in which package this annotation reside.

--Application context: Application context is the spring container where all the beans are managed .We get beans from application context.

To check what is happening in background-

we can put logger in application.properties file as follows-

looging.level.org.springframework=debug



No comments:

Post a Comment

Fluent interface pattern

 public class UserConfigurationManager {     private String userName;     private String password;     private UserConfigurationManager() { ...