[Java] (Overview) Part 1 – Spring vs. Spring Boot vs. Spring MVC

Tram Ho

overview

Spring Framework has long been no stranger to Java programmers in general and Java Web in particular, it provides a lot of features to help build products more conveniently and quickly. Spring is now very widely used and is an almost indispensable part of Java EE products. It wouldn’t be an exaggeration to say that they are far from being able to build so many applications with just the Spring “ecosystem”. Along with that, we also encounter many times applications developed with Spring Boot , Spring MVC . So what is Spring Boot and Spring MVC? Are they different from Spring?

Let’s go through this article to generalize the above 3 terms and their basic differences! Let’s get started.

Spring Framework

Spring is an open source framework developed on the basis of Java , which simplifies the construction and development of enterprise java applications. It provides a comprehensive programming and configuration model for modern Java-based enterprise applications – on any type of deployment platform. Spring’s features are divided into many separate modules, your application can choose to use any module when needed and Spring Boot, Spring MVC also the modules in the Spring Framework container. The main and prominent feature of Spring Framework is Dependency Injection and Inversion of Control (IoC) to help you develop applications with loosely coupled capabilities.

Spring Boot

Spring Boot is a module in Spring Framework that provides the interface and the ability to develop standalone applications with very few cumbersome configuration steps or almost zero. Spring Boot is packed with a lot of libraries that depend on Spring Framework’s foundation modules but is minimized with long, complex code to provide convenience and suitability for each purpose when developing applications. .

Spring MVC

Like Spring Boot , Spring MVC is also a module in Spring Framework, but its main purpose is to build web applications based on MVC (Model – View – Controller) model. Spring MVC uses a lot of configurations from Spring so there are not many configuration files for different purposes in your application and it provides an HTTP- oriented web application development framework.

The difference

Spring vs. Spring Boot

SpringSpring Boot
Spring Framework is a widely used Java EE framework for building applications.Spring Boot Framework is widely used to develop REST APIs.
It aims to simplify Java EE development to make developers more productive.It is aimed at shortening the code length and providing the easiest way to develop Web Applications.
The main feature of Spring Framework is dependency injection .The main feature of Spring Boot is Autoconfiguration . It automatically configures classes based on requirements.
It helps make things simpler by allowing us to develop loosely coupled applications .It helps to create a standalone application with less configuration.
Programmers need to write a lot of code (pre-written code) to perform the minimal task.It reduces pre-written code.
To test the Spring project, we need to explicitly set up the server.Spring Boot provides embedded servers like Jetty and Tomcat, etc.
Developers manually define dependencies for the Spring project in pom.xml.Spring Boot comes with the boot concept in pom.xml, inside handling the download of dependency JARs based on Spring Boot Requirement.

Spring Boot vs. Spring MVC

Spring BootSpring MVC
Spring Boot is a Spring module to package Spring-based application with reasonable defaults.Spring MVC model view controller-based web framework is based on Spring.
It provides default configuration for building Spring-powered framework .It provides ready-to-use features to build a web application.
There is no requirement for descriptor files to deploy.Multiple deployment description files are required.
It avoids pre-written code and combines dependencies together in a single unit.It specifies each of the dependencies separately.
It reduces development time and increases productivity.It takes more time to achieve the same thing.

summary

Above are some of the concepts and differences between the 3 frameworks Spring , Spring Boot and Spring MVC . Hopefully, through this article, you will have a specific look and choose the right framework for the purpose and requirements in your application!

See more at: https://www.javatpoint.com/spring-vs-spring-boot-vs-spring-mvc

Share the news now

Source : Viblo