Spring Boot is so popular right now, there are so many technical articles and paid tutorials, and for those of you who don’t know what Spring Boot is, what is it? What’s the use? Today I will give you a detailed introduction.

Spring Boot is a framework that can be used to describe the Spring Boot framework.

In today’s flourishing Java backend framework, the Spring framework is undoubtedly the most popular and essential open source framework, and is firmly the leader of the Java backend framework.

Anyone who has used the Spring framework knows that Spring is popular because of two powerful things: IOC and AOP, IOC can help us manage the dependency of objects, greatly reduce the coupling of objects, and AOP’s aspect programming function can be more aspects of the use of dynamic proxy to achieve a variety of dynamic method functions (such as transactions, caching, logging, etc.).

To integrate with the Spring framework, you must use XML configuration files or annotated Java code configuration. Whether you use XML or code configuration, you need to know enough about the configuration of the relevant components to write a lot of lengthy configuration code.

And how many developers can master these configurations? Wouldn’t it be so easy if we just provided configuration parameters for the framework to automatically configure these components?

The Spring Boot framework was created to simplify the process of getting started.

What is Spring Boot? Spring Boot is a sub-project of the Spring open source organization and a one-stop solution for Spring components. It mainly aims to simplify the difficulty of using the Spring framework and save heavy configuration.

Spring Boot provides “Starters” for various components. As long as developers can set the specific parameters for each component, Spring Boot will automatically configure them, allowing developers to quickly build Java projects that rely on Spring components.

Spring Boot can not only create traditional WAR package applications, but also create standalone applications that do not depend on any external container (such as tomcat) and can be launched using the java-jar command. Spring Boot also provides a command-line tool to execute Spring scripts.

Spring Boot’s official website:

The projects. Spring. IO/spring – the boot…

Spring Boot

Github.com/spring-proj…

If you’re not sure what Spring is for, take a look at the purpose of its design!

· Provide a faster and easier start experience for Spring application development;

· Provide a set of common non-functional features that are often used in large projects, such as embedded servers, security, metrics, health checks, and external configurations;

· Zero code configuration generation and zero XML configuration;

Why is Spring Boot so popular? Why is Spring Boot so popular? Because it has the following characteristics.

1. Independent operation

Spring Boot is embedded with various Servlet containers, such as Tomcat, Jetty, and so on. Now there is no need to deploy into a war package in the container. Spring Boot can run independently as long as it is made into an executable JAR package, and all dependencies are in a JAR package.

2. Simplify Maven configuration

As shown in the figure above, you can now have the power of Spring Web by simply relying on the Spring-boot-starter-Web launcher package, which contains all web development dependencies, greatly reducing maven’s dependency configuration.

The full dependency tree can also be seen using the Maven command: MVN Dependency :tree:

Spring Boot can automatically configure Spring beans according to the classes in the current classpath or the classes in the JAR package. For example, adding a Spring-boot-starter-Web initiator can have the Web function without other configuration. You can also customize the assembly by adding relevant configurations to the configuration file. This will be covered in a later class, so stay tuned.

4. No code generation and XML configuration

Spring Boot configuration is done without code generation and without XML configuration files, all with the help of conditional annotations, one of the core features of Spring 4+.

5. Application Monitoring Spring Boot provides a series of endpoints to monitor services and applications and perform health checks on Spring applications.

Spring Boot has many advantages and features. Although it is easy to get started, it is not without its disadvantages. Any framework has its pros and cons, and Spring Boot is no exception, and I can probably summarize the following.

1. It is necessary to have a good understanding of the core technology principles of Spring Boot, otherwise it will be difficult once problems are encountered. Because everything is integrated, automatically configured. As such, you need to be familiar with the configuration information, and it is not easy to find problems.

2. It is difficult to smooth the migration from the original Spring project to the Spring Boot framework because some old XML configurations cannot be configured in Java and the need for additional XML files is not perfect. For example, if Tomcat was previously standalone and everything was configured online, you would have a lot of problems switching to built-in Tomcat.

Compared with the advantages, these disadvantages are not much. In short, Spring Boot is something that any of us Java developers should try to figure out.