What is the difference between Spring boot and spring MVC?

Source: Internet
Author: User

The Spring framework is like a family with many derivative products such as boot, security, JPA, and so on. But they are based on the spring IOC and AOP IOC, which provides dependency injection of container AOP, solves cross-sectional programming, and then implements the advanced features of other extended products based on the two. Spring MVC is a Servlet-based MVC framework that primarily addresses WEB development issues because the configuration of spring is so complex that the various XML, Javaconfig, and Hin processes are cumbersome. In order to simplify the use of the developer, the spring boot is creatively introduced, and the contract is better than the configuration, simplifying the spring configuration process.

Easier said than done: Spring initially decoupled application components with "Factory mode" (DI) and "proxy mode" (AOP). Everyone thought it was good, so we had an MVC framework (some spring decoupled components) that was used to develop a Web application (SPRINGMVC). Then found that every development wrote a lot of boilerplate code, in order to simplify the workflow, so the development of some "lazy integration package" (starter), which is Spring Boot.

Features of Spring MVC

Spring MVC provides a mildly coupled way to develop Web applications.

Spring MVC is a module of spring, a web-framework. With dispatcher Servlets, Modelandview and View Resolver, it's easy to develop Web applications. The problem areas addressed are Web application or service development--url routing, Session, template engine, static Web resources, and so on.

Features of Spring Boot

Spring boot implements automatic configuration, reducing the complexity of project construction.

It is well known that the spring Framework requires a lot of configuration, and spring boot introduces the concept of automatic configuration, making project settings easy. Spring boot itself does not provide the core features and extensions of the spring framework, but is for rapid and agile development of a new generation of spring-based applications. That is, it is not a solution to replace spring, but rather a tool that works closely with the spring framework to enhance the spring developer experience. It also integrates a large number of commonly used third-party library configurations (such as Jackson, JDBC, Mongo, Redis, mail, and so on), and these third-party libraries in the Spring boot application are almost zero-configured out-of-the-box (Out-of-the-box), Most spring boot applications require very little configuration code, and developers can focus more on business logic.

Spring boot is just a bearer that assists you in simplifying the project setup process. If you are hosting a Web project that uses spring MVC as the MVC framework, then the workflow is exactly the same as what you described above, because this part of the work is done by spring MVC rather than spring Boot.

For the user, after swapping with spring boot, the project initialization method has changed, the configuration file has changed, and there is no need to install a separate Tomcat container server, Maven hit the jar package run directly is a website, But your most core business logic implementations have nothing to do with business process implementations.

So, in the most concise language, the summary is:

Spring is a "engine";

Spring MVC is an MVC framework based on spring;

Spring Boot is a set of rapid development integration packages based on SPRING4 conditional registration.

Reprint: https://www.zhihu.com/question/64671972/answer/223383505

What is the difference between Spring boot and spring MVC?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.