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 With more and more software integrated with Spring, Spring has gradually changed from a simple and simple small framework to a large and complete open source software. The boundary of Spring has been constantly expanded, and Spring can do almost anything later. 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.
Spring Boot makes development easier Spring Boot improves development efficiency in an all-round way. We can simply make a comparison:
What we need to do to develop a Web project before using Spring Boot:
1) Configure web.xml, load Spring and Spring MVC 2) configure database connection, configure Spring transactions 3) Configure load configuration file reading, enable annotations 4) Configure log file… N) After the configuration is complete, you may need to consider the compatibility of various versions and the feasibility of jar package conflicts.
So what do we need to do to develop a Web project after using Spring Boot?
IO/select the corresponding component to download directly. 2) Import the project, directly develop the above N steps and the following 2 steps form a huge contrast, this is only in the development environment construction of this aspect.
Spring Boot provides great support for testing. There are seven powerful testing frameworks built into Spring Boot:
JUnit: a Unit testing framework for the Java language, Spring Test & Spring Boot Test: provides integration tests and tools for Spring Boot applications. AssertJ: A Java testing framework that supports streaming assertions, Hamcrest: Mockito: a Java mock framework JSONassert: an assertion library for JSON JsonPath: The JSON XPath library allows you to test everything from databases to mocks to the Web simply by introducing the Spring-boot-start-test dependency package into your project.
Spring Boot makes configuration easier. Here we need to understand 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.
When it comes to making deployment easier with Spring Boot, we have to say that 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.
It can be said that Spring Boot is an open source software with its own monitoring. At the beginning of the design, the monitoring problem of applications is taken into account, and a monitoring component is specially provided to complete the work. This component is Spring Boot Actuator. 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. Such as Java engineering, high performance and distributed, high performance, simple. High architecture. Performance tuning, Spring, MyBatis, Netty source analysis and big data and other knowledge points. If you want to get a high salary, want to learn, want to have a good employment prospects, want to compete with others can obtain advantages, want to enter ali interview but worry about the interview, you can come, Q group number is: 856443934