The background and advantages of spring boot series 01

Time:2020-3-9

No reprint without permission

Original author: Alphabet blog

The complete series of this article is from: spring boot in depth

1、 Preliminaries

Outline of this section

  • The background of spring boot
  • What has spring boot changed
  • Main features of spring boot
  • Steps of integrating third-party open source components with spring boot

2、 The background of spring boot

Before the spring boot, programmers using the spring framework configured the web application environment in this way, which requires a lot of XML configuration.

  • With the increasing number of Web project integration software, XML configuration is also increasing, XML configuration files are also increasing, and project dependency management is becoming more and more complex. The spring framework is also controversial, and configuration files are difficult to understand and error prone.
  • XML configuration files are not only complex, but most of them belong to template configuration, that is to say, more than 80% of configurations are repeated. That is to say, the configuration in this web project is the same as that in another project.

Therefore, the lightweight web development framework like jfinal, because of its simple and easy-to-use features, gradually has a great development space. At the spring one 2gx conference in 2013, Central’s CTO, Adrian Colyer, responded to the question about the complexity of using the spring framework, and specifically mentioned that one of the future goals of the platform is to achieve XML free configuration and provide a better development experience. That’s why the spring boot we use today was born.

Let’s take an example: connect your own wires and standardized socketsThe configuration of spring boot, like plug and socket, is the standard. If you want to access the third-party open source library, you need to make a starter adaptation. Spring MVC is like connecting wires manually. It’s flexible, but different people connect wires with different effects, and it’s easy to make mistakes. Spring boot is not as flexible as spring MVC, and you don’t know what kind of line is in the socket, but it’s convenient and easy to use. In other words, when you are used to using plugs and sockets, which are easy to use, do you expect to be an electrician?

3、 What has spring boot changed

The goal of spring boot is not to provide new solutions for the solved problem areas, but to bring another new development experience for the platform, so as to simplify the use of these existing technologies.

  • Make configuration simple
  • Make monitoring simple
  • Make deployment simple
  • Make development simple

How can these changes be embodied? Please learn the following chapters!

4、 Main features of spring boot

  • Follow the principle of “agreement is better than configuration” to simplify configuration
  • It can be completely separated from the XML configuration file and adopt annotation configuration and Java config
  • Embedded servlet container, application can be executed with jar package: Java jar
  • Fast completion of project construction and integration of third-party class library, easy to use
  • It provides starter POM, which is very convenient for package management and simplifies package management configuration
  • Integrating with spring cloud naturally, spring boot is the best scheme to realize microservice in Java system

5、 Steps of integrating third-party class libraries with spring boot

  1. Introducing springboot-xxxx-starter through maven
  2. Modify ymal or properties global unified configuration file
  3. Add a Java config. This is a personalized configuration. If you use a common configuration, this step is not required.

Which official libraries have been integrated by default? Please refer to: https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/ ා using boot starter

No reprint without permission

Original author: Alphabet blog

The complete series of this article is from: spring boot in depth

This article is automatically published by artipub