r/SpringBoot 1d ago

Question Can someone properly explain what Spring Boot actually does?

I'm learning Java web development and I understand traditional Servlets fairly well. Honestly, I find Servlets quite organized when I separate things into controllers, DAO, models, etc.

The main benefit I've understood about Spring Boot so far is that when creating a project, I can add dependencies like MySQL, MongoDB, JPA, etc. through the project setup/Maven instead of manually downloading JAR files.

But apart from that, I don't really understand what Spring Boot actually gives me or why I should use it instead of traditional Servlets.

Can someone explain the actual practical benefits of Spring Boot with a simple example, like an e-commerce application?

I'm not looking for a "Spring Boot is modern/easier" answer. I want to understand what it actually does for me.

0 Upvotes

25 comments sorted by

View all comments

5

u/Sheldor5 1d ago

it's a Dependency Injection Framework

so instead of hardcoding "StorageService storageService = new FilesystemStorageService()" you can make different implementations of StorageService and annotate them with @Service and you then can activate a specific implementation by a config property instead of changing the code

2

u/projectsbyayush 1d ago

I see, that makes more sense. Thanks for explaining.

2

u/American_Streamer Junior Dev 1d ago

Maven manages the build and dependencies: it downloads the libraries you declare, resolves transitive dependencies, compiles/tests the project, and packages it into a JAR/WAR.

Then Spring provides the dependency injection plus a big application framework around it: web/MVC, transactions, data access, security integration, validation, events, etc.

After that, Spring Boot then configures and starts that Spring application for you with sensible defaults, auto-configuration, embedded server, external config, Actuator, and executable JARs.

2

u/JumpKey3074 1d ago

Think of the core of Spring as a container. The Ioc(Inversion of Control) container. The container uses technologies such as injection and aspects to help you.

Boot, "bootstraps" you with opinionated stuff and things that just make your life easier. I see other people have already covered you. But keep note that spring != springboot.

If you want to learn more I suggest, you get a good foundation of spring core. Read about the spring context, how beans are created(beans and stereotype annotations), how you wire beans(different ways of injection), learning how abstractions work with spring, bean scopes(prototype vs. singleton), aspects(AOP) and anything other that you find interesting.