Spring Boot-301 Flashcards
What is spring.provides
Each starter has a spring .provides file, which tells by using this starter package what we will get it : spring-test, spring-boot, spring-junit…
What is the nomenclature for starter pack?
spring-boot-starter-[…](web, data,
What is a CommandLineRunner
scan all components and invokes
How can we the Order of invokation of beans?
@Order or implement and Ordered IF
Is there a IN to extends in corresponding to each @Spring Annotation
Yes , extend it and customize
Does Boot creates the DataSource automatically?
Yes the Boot will create DS for H2, Derby , HSQL, just have to add one in CP
Show the class of SpringBootApplication ?
@Configuration @EnableAutoConfiguration @ComponentScan public Interface SpringBootApplication { }
Is SpringBootApplication an IF
Yes
What @Configuration does?
It says that @BEan, @ComponentScan & @Service
What @ComponentScan does?
It says that to scan all base packages for Spring annotaions. THe base package is the package the SpringBootApplication belongs to
What @EnableAutoConfiguratioon?
It composes of EnableAutoConfigurationalImmortSelecrtor
& ConfigurationPackages.Registrar to automatically configure the conditional beans
What does SpringApplication.run does?
It creates a Spring application context, that reads the annotations of class in parenthesis and instantiates
IS CommandLineInterface is and IF?
Yes
Which method CommandLineInterface has>?
Just one method public void run(String… args)
What is the relevance of run in CommandLineInterface
it just called once when SpringBoots