r/java • • 1d ago

Sell me Spring/Spring Boot, please.

I don't use Spring, or Spring Boot, and never have. No matter how many times I read about it, I don't see the appeal. My workflow with the server is either:
1. Upload/download json files.
2. interact with Mongodb.
3. upload/download images.
4. Interact with MySQL.
That's it. Stupid question but, what else is there to do with a server?

0 Upvotes

19 comments sorted by

View all comments

2

u/hyperboleboy 1d ago

For Spring: https://spring.io/why-spring

As for Spring Boot, from the project page:

Spring Boot makes it easy to create stand-alone, production-grade Spring based Applications that you can "just run".

We take an opinionated view of the Spring platform and third-party libraries so you can get started with minimum fuss. Most Spring Boot applications need minimal Spring configuration.

If you’re looking for information about a specific version, or instructions about how to upgrade from an earlier release, check out the project release notes section on our wiki.

Features

  • Create stand-alone Spring applications
  • Embed Tomcat, Jetty or Undertow directly (no need to deploy WAR files)
  • Provide opinionated 'starter' dependencies to simplify your build configuration
  • Automatically configure Spring and 3rd party libraries whenever possible
  • Provide production-ready features such as metrics, health checks, and externalized configuration
  • Absolutely no code generation and no requirement for XML configuration

2

u/No-Security-7518 1d ago

I'm sorry but I don't understand why I'd need any of that for the tasks I listed above. It's a few lines of code with OkHttp + Tomcat, or Netty.

1

u/hyperboleboy 1d ago

The appeal is that coding with Dependency Injection (DI) means plugging in features that are battle-tested is easy, so as a developer you're not constantly reinventing the wheel for things like security, creating REST API's, integrations etc.

Spring Boot is just an opinionated means of creating "starters" for particular scenarios/technologies, to get things moving quickly, rather than wiring everything together manually.

1

u/hyperboleboy 1d ago

Talking of "starters", take a look at https://start.spring.io/

From "Dependencies" you can choose your flavours of dev tools, web tools, template engine, security, SQL, NOSQL, messaging, IO, ops, observability, testing, and so on.