This is the sixth day of my participation in the November Gwen Challenge. See details: The Last Gwen Challenge 2021.

1. What is SpringBoot, its advantages and disadvantages?

SpringBoot is used to simplify the application development of Spring, with more conventions than configurations. SpringBoot has many functions, among which the most important function is automatic configuration and simplification of civilization.

1) Advantages Build projects quickly. Configuration-free integration with mainstream development frameworks. Projects can run independently without external dependencies on the Servlet container. Provides runtime application monitoring. Greatly improve the efficiency of development and deployment. Natural integration with cloud computing.

2) The iteration speed of the defective version is fast, and some modules are greatly changed.

Because you do not have to configure yourself, it is difficult to locate errors. There are fewer ready-made solutions online.

2. Describe the annotation function of @Configuration@bean@ComponentScan @propertysource @Value in SpringBoot

@Configuration tells Spring that this is a Configuration class, and the Configuration class === Configuration file

@bean injects a Bean into the container of type return value type and id default method name as ID

@ComponentScan Value: Specifies the package to be scanned

The @propertysource annotation is used to import an external configuration file to use the imported properties

The @value annotation is used to assign a Value to a property, either as a constant, using an SpEL expression, or using ${} to import the property from the configuration file in the configuration class above

3. What are the differences between Spring Boot, Spring MVC and Spring

Spring MVC and Spring Boot belong to Spring

Spring MVC is an MVC framework based on Spring. Spring Boot is a set of rapid development integration packages based on Spring. Spring is the core, providing basic functions.

Spring is like a big family, with many derivative products such as Boot, Security, JPA and so on. But their foundation is Spring’s IOC, which provides a dependency injection container, and AOP, which addresses section-oriented programming and then builds on that foundation to implement the advanced functions of other derivatives;

4. What is YML? Syntax format (say 3 points)

YAML is a markup language similar to XML and JSON. YAML emphasizes a data-centric focus rather than a markup language. Thus YAML itself is relatively simple to define and claims to be “a user-friendly data format language.”

  1. K: V: write it literally;
  2. Strings do not use single or double quotation marks by default.
  3. “” : double quotation marks; Does not escape special characters inside the string; Special characters act as their intended meaning
  4. “: single quotation mark; Special characters are escaped, and the special characters end up just plain string data

5. What are the core annotations for Spring Boot? What are the main notes?

The core annotation of SpringBoot is @SpringBootApplication, which consists of the following three annotations:

@springBootConfiguration: it combines the Configuration annotation to implement the Configuration file function.

@enableAutoConfiguration: enable automatic configuration or disable a specified automatic configuration option, such as data source autoconfiguration: @ SpringBootApplication (exclude = {DataSourceAutoConfiguration. Class}).

@ComponentScan: Spring scans components.