Spring Boot is a new framework from the Pivotal team designed to simplify the initial setup and development process for new Spring applications. The framework uses a specific way to configure so that developers no longer need to define boilerplate configurations. Spring Boot simplifies spring-based application development by making it possible to create a stand-alone, production-level Spring application with a small amount of code.

As a Java programmer, if you have been tired of the traditional development mode and want to have a new framework to provide rapid development, simple integration of programming experience, it is strongly recommended that you learn to understand Spring Boot. Spring Cloud may be weakened in the future with the development of Kubernetes and Service Mesh, but the impact of Spring Boot on development is profound.

The birth of Spring Boot

As more and more software is integrated with Spring, Spring has gradually changed from a simple and simple framework to a large and complete open source software. The boundaries of Spring have been constantly expanded, until Spring can do almost anything. The mainstream open source software and middleware in the market are all supported by Spring corresponding components. After people enjoy the convenience of Spring, they also encounter some problems.

Every time Spring integrates open source software, some basic configuration needs to be added. Gradually, as people develop larger and larger projects, they often need to integrate a lot of open source software. Therefore, in the later development of large projects using Spring, many configuration files need to be introduced, and too many configurations are difficult to understand and prone to configuration errors. Eventually Spring was called configuration hell.

Spring seems to recognize these problems, and there is an urgent need for a suite of software that can address them, at a time when the concept of microservices is emerging and the need to quickly develop small, stand-alone applications is becoming more urgent. Spring is at a crossroads. The development of Spring Boot project began in early 2013, and Spring Boot 1.0.0 was released in April 2014.

The baidu Index of Spring Boot from 2014 to 2018 is shown above, which shows the search spike caused by the launch of Spring Boot 2.0.

Spring Boot is not meant to replace Spring. Spring Boot is built on Spring to make it easier for people to use Spring. Seeing the market response of Spring Boot, Spring officials also attach great importance to the follow-up development of Spring Boot. Spring Boot has been promoted as the company’s top project and placed in the first place on the official website. Therefore, the continued development of Spring Boot is also expected.

Advantages of using Spring Boot

Spring Boot makes development easier

Spring Boot has improved development efficiency in an all-round way. We can make a simple comparison:

What we need to do to develop a Web project before using Spring Boot:

1) Configure web. XML and load Spring and Spring MVC

2) Configure database connections and Spring transactions

3) Config load config file reading, enable annotations

4) Configure log files

N) Deploy Tomcat debugging after the configuration is complete

You may also need to consider version-by-version compatibility and the possibility of jar package conflicts.

So what do we need to do to develop a Web project after using Spring Boot?

1) Log in to start.spring. IO/and select the corresponding component to download directly

2) Import the project and develop directly

The contrast between the N steps above and the 2 steps below is huge, and this is just the aspect of the development environment setup.

Spring Boot makes testing easier

Spring Boot’s testing support is powerful, with seven powerful testing frameworks built in:

JUnit: a unit testing framework for the Java language

Spring Test & Spring Boot Test: Provides integration testing and tooling support for Spring Boot applications

AssertJ: A Java testing framework that supports streaming assertions

Hamcrest: A library of matchers

Mockito: A Java mock framework

JSONassert: AN assertion library for JSON

JsonPath: JSON XPath library

All you need to do is introduce the Spring-boot-start-test dependency package into your project to test everything from databases to mocks to the Web.

Spring Boot makes configuration much easier

Spring Boot makes configuration easier, so let’s take a look at the core idea of Spring Boot: convention is better than configuration. So what is convention over configuration? Convention over Configuration, also known as programming by convention, is a software design paradigm that aims to reduce the number of decisions software developers have to make and gain the benefits of simplicity without losing flexibility.

Essentially, the developer only has to specify the non-conforming parts of the application. For example, if there is a class named User in the model, the corresponding table in the database will be named User by default. Only if you deviate from this convention, such as naming the table “user_info,” do you need to write the configuration for that name.

The Spring Boot system fully demonstrates the principle of contract over configuration, from configuration files, the default configuration of middleware, to built-in containers, and various Starters in the ecology. Spring Boot encourages software organizations to create their own Starters. One of the core components of the Starter is the Autoconfigure module. The core function of the Starter is automatic assembly and default configuration of properties.

Spring Boot makes deployment easier

When it comes to making deployment easier, Spring Boot has built-in containers. The embedded container not only makes deployment easy, but also brings great convenience in the development and debugging stage. Compared with the tedious configuration of Tomcat when developing Web projects in the past, it will make you feel more deeply when developing Spring Boot embedded container. Using Spring Boot to develop Web projects allows us to write business code without worrying about the environment of the container.

Today, Maven and Gradle have become indispensable building tools for our daily development. Using these tools, it is easy to package projects into Jar or War packages, and we can start projects on the server with only one command. Spring Boot supports adding customizations at startup time, such as setting the heap memory of the application, garbage collection mechanism, log path, and so on.

The development of virtualization technology brings us more possibilities. We can make use of containerization technology to mirror Spring Boot projects and realize elastic expansion and dynamic deployment according to the container cluster policy. Therefore, Spring Boot + Docker + Jenkins will make the deployment of Spring Boot project more simple and intelligent.

Spring Boot makes monitoring easier

It can be said that Spring Boot is an open source software with its own monitoring. Considering the monitoring problem of applications at the beginning of design, a monitoring component is specially provided to complete this work. This component is

Spring Boot physical. Spring Boot Actuator is an integrated feature that monitors application systems provided by Spring Boot. It can view detailed application configuration information, such as automatic configuration information, created Spring Beans, and some environment properties.

Of course, although Spring Boot Actuator can monitor the health of a Spring Boot application, in fact, current systems require many services to cooperate with each other to complete the work. How to use a monitoring software to monitor all Spring Boot projects becomes urgent. In the open source community, some people have realized this problem and developed a powerful monitoring software based on Spring Boot Actuator, which is Spring Boot Admin.

With Spring Boot, Admin can monitor not only the Spring Boot project, but also the Spring Cloud project.

Simple, intuitive, easy to use is its characteristics, for some special cases can also provide alarm services. Therefore, using Spring Boot Actuator solves the monitoring problem of a single Spring Boot, while using Spring Boot Admin solves the monitoring problem of the whole cluster.

If you want to learn Java engineering, high performance and distributed, simple. Performance tuning, Spring, MyBatis, Netty source code analysis of friends can add my Java senior programmer group: 180705916, there are ali Daniel live broadcast technology, as well as Java large Internet technology video free to share to you.