What can Spring do
We have learned about the IOC container of Spring, AOP, springMVC to develop Web applications, etc.
At the macro level, however, Spring is an ecosystem.
What can Spring do? Please refer to the official website:
- Microservices development: As the system becomes more functional, it needs to be further broken down, one module at a time, one application at a time. Spring can help you develop microservices quickly.
- Reactive programming: A way to build asynchronous data flows across applications based on asynchronous non-blocking. Asynchronous data streaming allows you to build a high-throughput application using a small amount of resources, such as threads, memory, CPU, etc.
- Cloud Distributed cloud development: Distributed applications are generated when large applications are broken down into smaller applications. Cloud provides solutions.
- Develop web applications: Use the framework to interact with the backend system as in the previous example
- Serverless: no service development. To put it simply, functions are as services. There is no need to purchase any server, go to the cloud platform, and charge according to the actual occupied resources to save costs.
- Event-driven: Real-time data streams are constructed based on events, and the development of high-throughput applications can be completed through responsive programming.
- Batch: indicates batch processing services.
There is a wealth of content in the Spring ecosystem that together can help us accomplish so much, and these are just a few of the features.
Of course, the process of integrating content from the ecosystem can be a bit painful and often leads to “configuration hell”. This has already been experienced in the previous springMVC study, which is just the integration of springMVC.
So, who’s going to solve this problem? That’s right, SpringBoot.
Second, the springboot
Liberating cumbersome configuration is springBoot’s inherent mission.
Springboot is like a high-level framework, with the underlying Spring-framework. It can integrate the entire Spring stack and help us develop applications without writing heavy configuration.
For example, if you buy a computer, you can build it yourself, but you need to be very hands-on. But most people prefer to save trouble and buy a branded machine straight out of the box.
This study is based on springboot2, which also has a number of usage changes compared to the previous version due to the significant upgrade introduced in spring5.
The big update in spring5 is responsive programming, and in springboot2, the data access layer supports responsive development by building asynchronous data streams.
SpringBoot advantages
-
Create a standalone Spring application
-
Embedded Web server: Before developing the application with SpringMVC, the application was eventually put into a WAR package and eventually deployed to Tomcat. Therefore, the target environment also needs to install Tomcat, configuration, etc.
With SoringBoot, it doesn’t matter if the target environment doesn’t have Tomcat, it’s already integrated and can be run directly.
- Automatic starter dependency to simplify build configuration:
Instead of importing a bunch of dependencies to develop SpringMVC, you now import a dependency Web-starter. In addition, it can automatically help us control the imported version, to ensure that we can work together.
-
Automatic configuration of Spring and third-party features: This is our favorite feature that frees up configuration.
-
Provide production-level monitoring: Provide production-level monitoring, health check, and external configuration. With almost no configuration, operations can monitor metrics.
-
No code generation, no XML writing: Low-level automatic discovery scenario, configuration.
In short, SpringBoot is a one-stop framework for the entire Spring technology stack. Or to simplify the rapid development scaffolding of the Spring technology stack.
SpringBoot shortcomings
-
Releases arrive quickly and need to keep an eye on changes. This also shows that the ecological community is very active. In fact, it is not a weakness but a feature.
-
Encapsulation is too deep, the internal principle is responsible for, not easy to master.
How to learn Springboot
IO /projects/sp…
After entering the official address, click LEARN to see that there are many versions, mainly the official stable version. Click the document link after 2.5.4 GA to enter the description document.
The document structure
It is roughly divided into the following modules:
Official documents are important learning materials to rely on in the follow-up learning process.
To see what’s new to the version, go to github.com/spring-proj…
View version logs.