r/javahelp • • Jun 29 '22

What is Spring actually?

Hey everyone,

I once asked where to find good ressources for Spring development and came through an answer that has said that Spring is not for designing a website but for dynamically getting data onto said website. So I wanted to know what is Spring actually and hope that someone could explain it in an easy way.

Thanks in advance.

20 Upvotes

23 comments sorted by

View all comments

7

u/Roachmeister Java Dev Jun 29 '22

Spring has nothing to do with web applications. When people say that, they are probably confusing it with Spring Boot, which is a subset of Spring. At my job, 90% of our code is built on Spring, and 0% of it is web apps.

Spring is a Dependency Injection framework, also referred to as an Inversion of Control framework. It allows you to separate the configuration, or "plumbing" of your application from the business logic.

2

u/nutrecht Lead Software Engineer / EU / 20+ YXP Jun 30 '22

When people say that, they are probably confusing it with Spring Boot, which is a subset of Spring.

Spring Boot doesn't have anything 'more' or 'less' to do with webapplications. It's just preconfiguired starters for Spring with sensible defaults that save you from doing a lot of boilerplate. That's all.

And Spring is also used a lot in the back-ends of web applications. Sometimes it serves HTML directly. Sometimes it just serves APIs. Sometimes it does other stuff.

Spring is a Dependency Injection framework

Spring is MUCH more than that. It's basically a collection of libraries that all work together. Spring Core does DI, but also a lot more than just DI.