What are the differences and connections between spring, spring MVC, spring boot and spring cloud?


Brief introduction

Spring is a lightweight inversion of control (IOC) and aspect oriented (AOP) container framework. Spring enables you to write cleaner, more manageable, and easier to test code.

Spring MVC is a module of spring and a web framework. It is easy to develop web applications through dispatcher servlet, modelandview and view resolver. It is mainly aimed at website application or service development – URL routing, session, template engine, static web resources, etc.

Spring configuration is complex and cumbersome, so spring boot is introduced. The Convention is better than the configuration, which simplifies the spring configuration process.

Spring cloud, built on spring boot, is a global service governance framework.

Spring and spring MVC:

Spring is a one-stop lightweight java development framework. Its core is control inversion (IOC) and aspect oriented (AOP). It provides a variety of configuration solutions for the web layer (springmvc), business layer (IOC) and persistence layer (JDBC template);

Spring MVC is an MVC framework based on spring, which mainly deals with path mapping and view rendering of web development. It is a part of web layer development in spring framework;

Springmvc and springboot:

Spring MVC is an MVC framework for enterprise web development, covering front-end view development, file configuration, background interface logic development, etc. XML, config and other configurations are relatively cumbersome and complex;

Compared with spring MVC framework, springboot framework focuses more on Developing Micro service background interface rather than front-end view;

Springboot and springcloud:

Springboot uses the concept that default is greater than configuration, integrates multiple spring plug-ins developed rapidly, automatically filters redundant plug-ins that do not need to be configured, simplifies the development and configuration process of the project, cancels XML configuration to a certain extent, and is a set of scaffold for rapid configuration development, which can quickly develop a single micro service;

Most of the functional plug-ins of springcloud are implemented based on springboot. Springcloud focuses on the integration and management of global microservices, integrating and managing multiple springboot single microservices; Spring cloud relies on springboot development, which can be developed independently;

To sum up:

  • Spring is the core and provides basic functions;
  • Spring MVC is an MVC framework based on spring;
  • Spring boot is a rapid development integration package to simplify spring configuration;
  • Spring cloud is a service governance framework built on spring boot.