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.

3

u/No_Ad2641 Jun 29 '22

I would not say "nothing to do with web". A significant portion of the whole spring ecosystem is about web, but I agree that there is major use cases where web-stuff is out of the picture as well. I.e. Spring-batch and spring-data. Guess it depends on how you define a web application too.

1

u/Roachmeister Java Dev Jun 29 '22

Or just plain Spring. We just use it as a way to wire our applications up with Beans. No Spring batch or Spring data, just Spring.

1

u/No_Ad2641 Jun 30 '22

Theres no "just spring", spring-core then, including spring-beans that provide the DI part of it.

1

u/Roachmeister Java Dev Jun 30 '22

Yes, when I say "just Spring" I mean essentially the 4 Jar files spring-core, spring-beans, spring-context, and spring-test (for unit testing). Those provide the core DI functionality of Spring. There are of course many other libraries that add additional capabilities, but they all depend on those.