Spring framework is like a family, with many derivative products such as boot, security, jpa, etc. But their foundation is Spring's ioc and aop ioc provide dependency injection container aop, solves cross-sectional programming, and then implements advanced features of other extended products based on both. Spring MVC is an MVC framework based on Servlets. It mainly solves the problems of WEB development, because Spring's configuration is very complex and various XML, JavaConfig, and hin are complicated to handle. Therefore, in order to simplify the use of developers, Spring boot was creatively launched, which agreed to be better than configuration and simplified the configuration process of spring.
To put it simply: Spring initially used Factory Mode (DI) and Agent Mode (AOP) to decouple application components. Everyone thought it was very useful, so they formed an MVC framework (some components decoupled by Spring) according to this model, and used development web applications (SpringMVC). Then I found that every time I develop, I write a lot of boilerplate code. In order to simplify the workflow, some "lazy integration packages" were developed, which is Spring Boot.
Spring MVC features
Spring MVC provides a lightly coupled way to develop web applications.
Spring MVC is a module of Spring, a web framework. Developing web applications is easy with Dispatcher Servlet, ModelAndView and View Resolver. The problem areas solved are website application or service development - URL routing, Session, template engine, static Web resources, etc.
Spring Boot features
Spring Boot implements automatic configuration, reducing the complexity of project construction.
As we all know, the Spring framework requires a lot of configuration. Spring Boot introduces the concept of automatic configuration, making it easy to set up a project. Spring Boot itself does not provide the core features and extension functions of the Spring framework, but is only used to quickly and agilely develop a new generation of Spring framework-based applications. That is to say, it is not a solution to replace Spring, but a tool that is closely integrated with the Spring framework to enhance the Spring developer experience. At the same time, it integrates a large number of commonly used third-party library configurations (such as Jackson, JDBC, Mongo, Redis, Mail, etc.). These third-party libraries in Spring Boot applications can be used out-of-the-box with almost zero configuration. Most Spring Boot applications only require a very small amount of configuration code, and developers can focus more on business logic.
Spring Boot is just a carrier, helping you simplify the project construction process. If you are hosting a WEB project and using Spring MVC as the MVC framework, then the workflow is exactly the same as you described above, because this part of the work is done by Spring MVC rather than Spring Boot.
For users, after using Spring Boot, the project initialization method has changed and the configuration file has changed. In addition, there is no need to install container servers like Tomcat separately. Maven prints a jar package and runs it directly. However, your core business logic implementation and business process implementation have not changed at all.
Therefore, in the most concise language, it is:
Spring is an "engine";
Spring MVC is an MVC framework based on Spring;
Spring Boot is a fast development integration package based on Spring4's conditional registration.
Summarize
The above is the difference and function introduction of spring boot and spring mvc introduced to you by the editor. I hope it will be helpful to you. If you have any questions, please leave me a message. The editor will reply to you in time!