What is Spring Boot? Explain its advantages and disadvantages and the four cores in detail

Author: Insist--

Personal homepage: insist--personal homepage

The author will continue to update network knowledge and python basic knowledge , looking forward to your attention

Table of contents

1. What is Spring Boot?

2. Advantages and disadvantages of Spring Boot

1. Advantages

① Quickly build an independent Spring application

② Directly embedded in Tomcat, Jetty and Undertow servers

③ Simplify build configuration by relying on the launcher

④ Automatically configure Spring and third-party libraries

⑤Provide production-ready functions

⑥ Minimal code generation and XML configuration

2. Disadvantages

3. The four cores of Spring Boot

1. Automatic configuration

2. Start dependency

3、Actuator

4. Command interface

4. Application Scenarios of Spring Boot

1. Quickly build RESTful API services

2. Quickly build a microservice architecture

3. Quickly build enterprise-level applications

4. Quickly build cloud-native applications


foreword

This article will explain what is Spring Boot? Explain its advantages and disadvantages, four cores and application scenarios in detail.

307173c153be4109911e2801bcbf8f37.WEBP

1. What is Spring Boot?

Spring Boot is a new framework provided by the Pivotal team, which is designed to simplify the initial construction and development process of new Spring applications . The framework uses a specific approach to configuration, so that developers no longer need to define boilerplate configuration . In this way, Boot aims to be a leader in the burgeoning field of rapid application development.

2. Advantages and disadvantages of Spring Boot

4e34b360590a4a8ea25a4a5d1c72d878.jpg

1. Advantages

① Quickly build an independent Spring application

Spring Boot is a new framework that relies on a large number of annotations to achieve automatic configuration . When building a Spring application, we only need to add the corresponding scenario dependencies, and Spring Boot will automatically configure according to the added scenario dependencies , and quickly build an independent Spring application without additional manual configuration.

② Directly embedded in Tomcat, Jetty and Undertow servers

When deploying a traditional Spring application, the application is usually packaged as a WAR package and deployed to a Tomcat, Jetty or Undertow server. The Spring Boot framework embeds Tomcat, Jetty and Undertow servers, and can automatically package the project and deploy it to the server when the project is running.

③ Simplify build configuration by relying on the launcher

During the construction of the Spring Boot project, there is no need to prepare various independent JAR files . You only need to select the corresponding dependency starter "starter" according to the development scenario requirements when building the project. The imported dependency starter "starter" has already included Corresponds to the dependencies required for the development scenario, and will automatically download and pull the relevant JAR packages .

④ Automatically configure Spring and third-party libraries

Spring Boot fully considers the integration scenarios with the traditional Spring framework and other third-party libraries. On the basis of providing various scenario-dependent starters, it provides various automatic configuration classes (such as RedisAuto Configuration) by default. When using Spring Boot to develop a project, once the dependency starter of a certain scenario is introduced, the default automatic configuration class provided by Spring Boot will take effect, and developers do not need to manually configure related configurations in configuration files (unless developers need to change the default configuration ), thereby greatly reducing the workload of developers and improving the efficiency of program development.

⑤Provide production-ready functions

Spring Boot provides some features for production runtime , such as metrics, monitoring checks and externalized configuration. Among them, indicators and monitoring checks can help operation and maintenance personnel monitor project operation during operation and maintenance; external configuration can enable operation and maintenance personnel to quickly and easily perform external configuration and deployment.

⑥ Minimal code generation and XML configuration

The Spring Boot framework has internally realized the integrated connection with Spring and other commonly used third-party libraries, and provides a default optimized integration configuration, basically no additional configuration code and XML configuration files need to be generated during use. In the case of custom configuration, Spring Boot advocates the use of Java config (Java configuration class) to replace the traditional XML configuration method, which is more convenient for viewing and management.

2. Disadvantages

Spring Boot also has some significant disadvantages:

For example, it is relatively simple to get started with Spring Boot , but it is difficult to understand and learn in depth . This is because Spring Boot is launched on the basis of the Spring framework, so readers want to understand the underlying operating mechanism of Spring Boot. Framework has a certain understanding.

3. The four cores of Spring Boot

1. Automatic configuration

For many Spring applications and common application functions, Spring Boot related configuration can be automatically provided, and a complete framework can be built through simple configuration or even zero configuration .

2. Start dependency

Tell Spring Boot that it can introduce the required dependency library; by starting the dependency mechanism (Starter), simplify the reference of the jar package and resolve the conflict of the jar version.

3、Actuator

It is a program monitor of SpringBoot , which can monitor Beann in the Spring application context , view automatic configuration decisions, Controller mapping, thread activity, application health status, etc. , and can go deep into the running Spring Boot application to explore the internal information of the Spring boot program.

4. Command interface

This is an optional feature of Spring Boot mainly used in Grovy language .

4. Application Scenarios of Spring Boot

1. Quickly build RESTful API services

Spring Boot provides a series of automatic configuration and basic components that can help you quickly build Spring MVC-based RESTful API services.

2. Quickly build a microservice architecture

Spring Boot provides a series of microservice tools and components, including service registration and discovery, load balancing, circuit breakers, etc., which can help you quickly build a microservice architecture.

3. Quickly build enterprise-level applications

Spring Boot provides a wealth of enterprise-level application components, including data persistence, message middleware, security authentication, task scheduling, etc., which can help you quickly build enterprise-level applications.

4. Quickly build cloud-native applications

Spring Boot provides support for cloud-native applications, including the integration of cloud services, support for containerized applications, etc. , which can help you quickly build cloud-native applications.

Guess you like

Origin blog.csdn.net/m0_73995538/article/details/131293800