r/javahelp • u/mslayaaa Software Engineer • Nov 26 '19
Codeless Explain like I'm 10
What is Spring Boot? How is the Spring Boot framework useful? For what is it used most often?
9
u/x2mirko dev Nov 26 '19
Spring is a framework that takes care of a whole lot of things most large-scale applications need (for example: Persistence and Security). Instead of having to implement these functions yourself, you just have to configure the framework to do it for you and only implement the parts of your application that are relevant to your business logic (e.g. if you're writing software for a movie store, you don't want to handle all the details of how users log in, but you do want to write code that makes sure that the user has the right age to be allowed to buy the movie).
This is already very nice, but the main problem with spring is that there are so many things it can do that if you're new to the framework, it's very overwhelming and you don't know what to use, where to configure what and how to do it. Spring Boot makes this process easier by providing sensible defaults for most things and providing meta-packages such that you can basically say: "I'll need an oracle database connection and I need users to authenticate via HTTPS" and everything else is taken care of. You can then always dive in later to change details of the configuration, but you don't have to do so up front.
2
u/mslayaaa Software Engineer Nov 26 '19
Thank you for such an awesome explanation, really clears things up.
32
2
u/wildjokers Nov 26 '19
Spring boot is a configuration framework for Spring. Even with Spring Boot though spring configuration quickly becomes a nightmarish maze.
1
u/kamronkennedy Nov 26 '19
Like other have said: Spring is a suite of frameworks ready to use out of the box, for free. The spring suite can handle everything from authentication and session management, to cache, JSON serialization/deserialization, and Dependency Injection.
Spring Boot is one of those frameworks for easily getting an API up and running. API in this case meaning an HTTP RESTful API: accepts/produces JSON bodies, HTTP request methods to control what type of operation you need (POST, GET, UPDATE, DELETE)
Traditionally, Java web apps (and web apps in general) needed a server to host the web app and handle the HTTP traffic requests which would bind to the portions of your app that were configured. Which leads to some heavy maintenance requirements and skills that developers don't always have.
If you've ever made a Java class with a main method, and ran it from the command line, imagine if that's all you had to do to get your API up and running on port 8080.
That is Spring Boot specifically. A self contained server instance provided by the framework that will be started on execution and have your API(s) deployed to it, with no other installations needed beyond Java on the target machine.
Then comes all of the other frameworks and services the Spring Suite has to offer that can be used in conjunction with a Spring Boot project.
0
25
u/stayweirdeveryone Nov 26 '19
Spring boot is a framework built on top of Spring. It's used to get a Java application up and running based on pre-existing patterns rather than building everything from scratch. If Spring is a recipe for how to make a pizza, then spring boot is a lunchables pizza that just needs assembly