What is spring boot?
Spring Boot is a Spring-based framework provided by the Pivotal team, which uses a specific way to configure, so that developers no longer need to define boilerplate configurations. Spring Boot integrates most of the currently popular development frameworks. Just like Maven integrates all JAR packages, Spring Boot integrates almost all frameworks, allowing developers to quickly build Spring projects.
The operating environment of this tutorial: windows7 system, java8 version, DELL G3 computer.
Spring Boot is a new Spring-based framework provided by the Pivotal team, aiming to simplify the initial construction and development process of Spring applications. The framework uses an ad hoc approach to configuration, eliminating the need for developers to define boilerplate configurations.
The definition given by Spring’s official website is: Spring Boot is the starting point for all Spring-based development projects. Spring Boot integrates most of the currently popular development frameworks. Just like Maven integrates all JAR packages, Spring Boot integrates almost all frameworks, allowing developers to quickly build Spring projects.
The core design idea of Spring Boot is "convention over configuration". Based on this design principle, Spring Boot greatly simplifies project and framework configuration. For example, when using Spring to develop a web project, we need to configure web.xml, Spring and MyBatis, etc., and also need to integrate them together. Everything will become extremely simple using Spring Boot. It uses a large number of default configurations to simplify the configuration process of these files. You only need to introduce the corresponding Starters.
Spring Boot can build everything. It is designed to use the least configuration to start and run Spring projects as quickly as possible.Background of Spring Boot
Over the years, with the rapid development of Spring and the continuous addition of new features, Spring has become more and more complex.
You can see all of Spring's sub-projects and component frameworks by visiting the Spring official website. So many sub-projects and components make Spring gradually cumbersome, which is obviously unable to adapt to the development trends of the cloud computing and microservices era. .
So Spring Boot came into being. Spring Boot is built on the basis of Spring and follows the principle of "convention over configuration", avoiding the complicated configuration that must be done when creating a project or framework, helping developers use existing Spring more simply and conveniently with the least amount of work. All functional components in .Features of Spring Boot
A series of features of Spring Boot make it very easy to implement the microservice architecture. For many current technology stacks, Spring Boot is Java The optimal implementation technology of domain microservice architecture.
The following figure shows some features of Spring Boot:
Figure 1 Features of Sprint Boot
Core components of Spring Boot
Spring Boot officially provides encapsulation of many currently popular basic functional components. The names generally start with spring-boot-starter, such as the spring-boot-starter-quartz scheduled task component and the spring-boot-starter-thymeleaf page. Template engines, etc.In addition, due to the popularity of Spring Boot, many third-party middleware also provides Starters for Spring Boot projects in accordance with Spring Boot specifications, generally starting with the component name, such as MyBatis for Spring Boot. The component package mybatis-spring-boot-starter.
The core components of Spring Boot are shown in the figure below:

Figure 2 The core components of Spring Boot
Advantages of Spring Boot
Spring Boot inherits the consistent advantages and features of Spring, while adding some new functions and features, which makes Spring Boot very easy to use and also makes Programming becomes easier.
In summary, Spring Boot has the following advantages:- Following the principle of "convention over configuration", using Spring Boot only requires very little configuration or uses the default configuration.
- Use JavaConfig to avoid the hassle of using XML.
- Provide Starters to simplify Maven configuration and avoid dependency conflicts.
- Provides embedded Servlet containers, and you can choose to embed Tomcat, Jetty and other containers without the need for a separate web server. This means there is no longer any need to start Tomcat or any other middleware.
- Provides a series of non-functional features common in projects, such as security monitoring, application monitoring, health detection, etc.
Natural integration with cloud computing and microservices.
Why learn Spring Boot
In recent years, the most popular technical frameworks in the Spring ecosystem are Spring Boot and Spring Cloud. At present, various enterprises are promoting the implementation of microservice technology architecture, splitting a complex application into multiple small independent modules, deploying them separately without interfering with each other, thereby achieving loose coupling, improving development efficiency and reducing operation and maintenance costs. Purpose.
Spring Boot, as the foundation of the microservice framework, is increasingly used in enterprise-level development. It is the foundation of Spring Cloud. To learn Spring Cloud, you must understand the architecture and design philosophy of the Spring Boot framework.
Spring Boot is a sub-project under the Spring ecosystem, used to quickly and agilely develop a new generation of applications based on the Spring framework. At the same time, it combines various currently mature service frameworks and third-party components (such as Redis, MongoDB, JPA, RabbitMQ, Quartz, etc.) and encapsulates them into Starters components according to the design idea of "convention over configuration". In this way, we can use these components in Spring Boot applications with almost zero configuration to achieve out-of-box use, thereby liberating ourselves from complicated configuration and focusing more on the development of business logic.
The advantages of Spring Boot can be summarized in the following aspects:- Quick construction: Using Spring Initializr, you can quickly create projects and provide a wealth of solutions to facilitate the rapid integration of various solutions and improve development. efficiency.
- Simplify dependencies: Provide rich Starters, simplify Maven configuration, and avoid version compatibility issues.
- One-click deployment: Embedded Servlet containers, such as Tomcat and Jetty, can be directly packaged into executable JAR files and run independently. It supports Jenkins and Docker to easily realize automated operation and maintenance.
Application monitoring: Comes with Actuator monitoring component to easily monitor the status of services. Use Spring Boot Admin to easily deploy a fully functional application monitoring system.
In general, Spring Boot makes building, coding, configuring, deploying, and monitoring very easy. Spring Boot can be said to be one of the most influential projects in the Spring community and even the entire Java community in recent years.
Readers who are learning Spring Boot for the first time should not think of it as too complicated. Spring Boot is not a new language or a new technology. It just integrates existing popular frameworks, follows the principle of "convention over configuration", and works out of the box, so that we no longer need to pay attention to those cumbersome things. configuration. With this concept in mind, you can learn Spring Boot with a relaxed mood.What is "convention over configuration"
We know that the core design idea of Spring Boot is "convention over configuration", and all Starters provided by Spring Boot are implemented following this idea . So, what exactly 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 configuration items required by software developers, so that the software can remain simple without Loss of flexibility.
Essentially, the system, class library or framework should agree on reasonable default values, and developers only need to specify the parts of the application that do not comply with the agreement. For example, if there is a class named Product in the model, the corresponding table in the database will be named product by default. Only when you deviate from this convention do you need to define configuration about this name, for example, name the table product_info.
To put it simply, "Convention is better than configuration" means following the convention. If the agreed configuration of the tool you use meets your requirements, then you can omit this configuration; if it does not, just modify the relevant configuration to achieve the way you expect.
"Convention over configuration" is not a new concept. Many frameworks use the "convention over configuration" design paradigm, including Maven, Spring, Grails, Grok, Apache Wicket, etc.
Spring Boot is Spring's best practice product of "convention over configuration". From configuration files and default configurations of middleware to built-in containers and various Starters in the Spring ecosystem, they all follow the design philosophy of "convention over configuration". It is precisely because of the simplified configuration and numerous Starters that make Spring Boot simple, easy to use, and easy to get started. It is also the thorough implementation of the design idea of "convention over configuration" that makes Spring Boot achieve glory.The relationship between Spring, Spring Boot and Spring Cloud
With the continuous development of Spring, Spring Boot and Spring Cloud, more and more developers are joining the Spring army. For beginners, they may not know much about the concepts of Spring, Spring Boot and Spring Cloud and the relationship between them. Let's take a look at them together.
Spring is an open source ecosystem and a master. Its core is Inversion of Control (IoC) and Aspect Oriented Programming (AOP). It is the two core functions of IoC and AOP that make Spring powerful. Spring continues to develop and grow on these two core functions, and has a series of mature products such as Spring MVC, and finally builds a powerful Spring ecological empire. .
Spring Boot is developed on the basis of Spring. It is not intended to replace Spring, but to simplify the creation, running, debugging, and deployment of Spring applications, making it easier for developers to use Spring. It combines various currently mature service frameworks and third-party components, repackages them according to the design idea of "convention over configuration", shields out complex configuration and implementation, and ultimately provides developers with a simple and easy-to-use set of components. , an easy-to-deploy and easy-to-maintain distributed system development toolkit.
Spring Cloud is a distributed microservice framework based on Spring Boot. It uses Spring Boot's simple, easy-to-use, and convenient features to simplify the development of distributed system infrastructure, such as service discovery, service registration, and configuration center. , message bus, load balancing, circuit breaker, data monitoring and other basic components can be started and deployed with one click using the Spring Boot development style.
We all know that when using a microservice architecture, the number of services will be very large, and management will be particularly troublesome. Spring Cloud is a distributed microservice governance framework, which can be said to be the steward of these microservices. As a big housekeeper, Spring Cloud needs to provide various components and solutions to manage and maintain the entire microservice system, such as communication between services, circuit breaker, monitoring, etc. Spring Cloud uses the characteristics of Spring Boot to integrate outstanding components in the open source industry and provides a set of service governance solutions in a microservice architecture.
Spring Boot plays a connecting role in Spring Cloud. If you want to learn Spring Cloud, you must learn Spring Boot. The relationship between the three is shown in the figure below.Figure 3 The relationship between Spring, Spring Boot and Spring Cloud
For more programming-related knowledge, please visit: Programming Teaching! !
The above is the detailed content of What is spring boot?. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



In 2023, AI technology has become a hot topic and has a huge impact on various industries, especially in the programming field. People are increasingly aware of the importance of AI technology, and the Spring community is no exception. With the continuous advancement of GenAI (General Artificial Intelligence) technology, it has become crucial and urgent to simplify the creation of applications with AI functions. Against this background, "SpringAI" emerged, aiming to simplify the process of developing AI functional applications, making it simple and intuitive and avoiding unnecessary complexity. Through "SpringAI", developers can more easily build applications with AI functions, making them easier to use and operate.

As an industry leader, Spring+AI provides leading solutions for various industries through its powerful, flexible API and advanced functions. In this topic, we will delve into the application examples of Spring+AI in various fields. Each case will show how Spring+AI meets specific needs, achieves goals, and extends these LESSONSLEARNED to a wider range of applications. I hope this topic can inspire you to understand and utilize the infinite possibilities of Spring+AI more deeply. The Spring framework has a history of more than 20 years in the field of software development, and it has been 10 years since the Spring Boot 1.0 version was released. Now, no one can dispute that Spring

How to implement spring programmatic transactions: 1. Use TransactionTemplate; 2. Use TransactionCallback and TransactionCallbackWithoutResult; 3. Use Transactional annotations; 4. Use TransactionTemplate in combination with @Transactional; 5. Customize the transaction manager.

How to set the transaction isolation level in Spring: 1. Use the @Transactional annotation; 2. Set it in the Spring configuration file; 3. Use PlatformTransactionManager; 4. Set it in the Java configuration class. Detailed introduction: 1. Use the @Transactional annotation, add the @Transactional annotation to the class or method that requires transaction management, and set the isolation level in the attribute; 2. In the Spring configuration file, etc.

JUnit is a widely used Java unit testing framework in Spring projects and can be applied by following steps: Add JUnit dependency: org.junit.jupiterjunit-jupiter5.8.1test Write test cases: Use @ExtendWith(SpringExtension.class) to enable extension, use @Autowired inject beans, use @BeforeEach and @AfterEach to prepare and clean, and mark test methods with @Test.

Spring is an open source framework that provides many annotations to simplify and enhance Java development. This article will explain commonly used Spring annotations in detail and provide specific code examples. @Autowired: Autowired @Autowired annotation can be used to automatically wire beans in the Spring container. When we use the @Autowired annotation where dependencies are required, Spring will find matching beans in the container and automatically inject them. The sample code is as follows: @Auto

Technical practice of Docker and SpringBoot: quickly build high-performance application services Introduction: In today's information age, the development and deployment of Internet applications have become increasingly important. With the rapid development of cloud computing and virtualization technology, Docker, as a lightweight container technology, has received widespread attention and application. SpringBoot has also been widely recognized as a framework for rapid development and deployment of Java applications. This article will explore how to combine Docker and SpringB

In back-end management systems, access permission control is usually required to limit different users' ability to access interfaces. If a user lacks specific permissions, he or she cannot access certain interfaces. This article will use the waynboot-mall project as an example to introduce how common back-end management systems introduce the permission control framework SpringSecurity. The outline is as follows: waynboot-mall project address: https://github.com/wayn111/waynboot-mall 1. What is SpringSecurity? SpringSecurity is an open source project based on the Spring framework, aiming to provide powerful and flexible security for Java applications.
