Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What's the difference between Spring SpringMVC and SpringBoot?

2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

What is the difference between Spring SpringMVC and SpringBoot? I believe many inexperienced people don't know what to do about it. Therefore, this paper summarizes the causes and solutions of the problem. Through this article, I hope you can solve this problem.

I. concept

1 、 Spring

Spring is an open source container framework that can take over the components of web layer, business layer, dao layer, persistence layer, configure a variety of bean, and maintain the relationship between bean and bean. Its core is inversion of control (IOC), and aspect-oriented (AOP), which is simply a hierarchical, lightweight open source framework.

2 、 SpringMVC

Spring MVC is a follow-up product of SpringFrameWork and has been integrated into Spring Web Flow. SpringMVC is a web-layer mvc framework that replaces servlet (handling | responding to requests, getting form parameters, form validation, etc.). SpringMVC is an open source framework for MVC, and SpringMVC=struts2+spring,springMVC is the equivalent of the integration of Struts2 and Spring.

3 、 SpringBoot

Springboot is a micro-service framework, which continues the core ideas of spring framework, IOC and AOP, and simplifies the development and deployment of applications. Spring Boot is to simplify the creation, operation, debugging and deployment of Spring applications. Using it, we can focus on the development of Spring applications without paying too much attention to the configuration of XML. A bunch of dependency packages are provided, and the dependency problem has been solved according to usage habits-> habits are greater than conventions.

II. Principle and structure

1. The principle and composition of Spring

In order to simplify our development work, Spring encapsulates a series of out-of-the-box component functional modules, including: Spring JDBC, Spring MVC, Spring Security, Spring AOP, Spring ORM, Spring Test and so on. As shown below:

Simplified understanding diagram:

MVC:Model (model), VIew (view), Controller (controller); we know the architecture of javaWeb from the beginning of contact and learning MVC development, such as early Sturts1, Sturts2 and so on.

3. The principle and characteristics of SpringBoot.

Spring Boot is basically an extension of the Spring framework, eliminating the XML configuration required to set up Spring applications, paving the way for a faster and more efficient development ecosystem.

Some features in Spring Boot:

Create stand-alone spring applications.

Embed Tomcat, JettyUndertow and do not need to deploy them.

Provide "starters" poms to simplify Maven configuration.

Configure spring applications as automatically as possible.

Provide production indicators, robust inspection and externalization configuration.

There are absolutely no code generation and XML configuration requirements.

The composition and structure are shown below:

III. Difference and summary

1. To put it simply: Spring contains SpringMVC, while SpringBoot contains Spring or an extension based on Spring.

2. The relationship is something like this:

Spring mvc < spring < springboot

3. Some of the advantages of Spring Boot over Spring include:

Provide embedded container support

Run jar independently using the command java-jar

When deploying in an external container, you can choose to exclude dependencies to avoid potential jar conflicts

Flexible options for specifying configuration files at deployment time

Random port generation for integration testing

Spring Boot is just an extension of Spring itself, making it easier to develop, test and deploy.

After reading the above, have you mastered the difference between Spring SpringMVC and SpringBoot? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report