What is the difference and connection between Spring, SpringMVC, SpringBoot and SpringCloud?

Posted May 25, 20202 min read

basic introduction

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

Spring MVC is a module of Spring, a web framework. With Dispatcher Servlet, ModelAndView and View Resolver, developing web applications becomes easy. 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, which is better than configuration and simplifies the configuration process of spring.

Spring Cloud is built on Spring Boot and is a service governance framework that focuses on the whole world.

Spring and SpringMVC:

Spring is a one-stop lightweight Java development framework, the core is control inversion(IOC) and aspect-oriented(AOP), for the development of WEB layer(springMvc), business layer(Ioc), persistence layer(jdbcTemplate) Etc. have provided a variety of configuration solutions;

SpringMVC is an MVC framework based on Spring, which mainly handles path mapping and view rendering for web development, and is part of the development of the WEB layer in the Spring framework;

SpringMVC and SpringBoot:

SpringMVC belongs to an MVC framework developed by an enterprise WEB. Its coverage includes front-end view development, file configuration, and background interface logic development. The configuration of XML and config is relatively cumbersome and complex;

Compared with the SpringMVC framework, the SpringBoot framework is more focused on the development of microservice background interfaces, and does not develop front-end views;

SpringBoot and SpringCloud:

SpringBoot uses the concept that the default is greater than the configuration, integrates multiple plug-ins for rapid development of Spring, and automatically filters unnecessary plug-ins that do not need to be configured. The developed scaffolding can quickly develop a single microservice;

Most of SpringCloud's functional plug-ins are implemented based on SpringBoot. SpringCloud focuses on global microservice integration and management, integrating and managing multiple SpringBoot single microservices; SpringCloud depends on SpringBoot development, and SpringBoot 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.