DEV Community

Cover image for What is better to use Spring Boot or Spring MVC?
narendra8989
narendra8989

Posted on

What is better to use Spring Boot or Spring MVC?

Both Spring Framework & Spring Boot are used to create Java Enterprise applications.
One could do everything using Spring Framework that can be achieved by Spring Boot.

Most of the people Prefer Spring Boot Because

Convention over Configuration
It’s a software design paradigm used by many software frameworks/systems that provides sensible defaults to its user obviously by following the best practices and without losing flexibility.

The impact of this design principle are profound and these includes; good architecture, maintainability, uniform & standard product creation, lesser number of decisions for the user, increase in the overall productivity, faster development etc just to mention a few.

The idea is that, system/framework would provide sensible defaults for their users [by convention] and if one deviates/departs from the these defaults then only one needs to make any configuration changes. Let’s take some
Examples:

Example 1: (Deployment Simplified)
Suppose user is creating a web application following Spring MVC then it’s obvious that the user will be needing a container like Tomcat to deploy this application. If your framework can provide embedded Tomcat then user don’t have to waste their time & effort in installing, configuring their Tomcat instance. If one doesn’t want this default behavior then framework should have flexibility for that also.

Work For You : Look out for the dependent jars of spring-boot-starter-web artifactId
org.springframework.bootspring-boot-starter-web
Let me know, what have you found? :-)

Example 2: (Dependency Management Simplified)
If you have developed your enterprise application using Spring Framework (traditional way) then you surely know the headache of finding of right jars, right versions of jars, upgrading the version of jars and many more.
What if, user can get all the dependent jars along with their transitive dependencies out of box by simply pointing out that they need jars related to web or security or jpa etc.
Work For You: Check out Spring Boot Starter Packs like spring-boot-starter-web, spring-boot-starter-actuator etc
Rapid Application Development
One sentence, maximizing the code that actually adds value or related to your domain & reducing the boilerplate code. Take an example: code in your application that marshals XML or JSON has no customer value nor does it have a developer benefit
Now we have discussed the design philosophy behind the creation of Spring Boot. What it actually does? How does it help?

Accelerate the development

Developers invest their time in creating solutions that actually matters and adds values rather than wasting hour [both effort & time] in setting up their development environment, projects, making configuration changes and writing boilerplate codes

Meet The Experts For Better Guidence : https://nareshit.com/spring-online-training/

Top comments (0)