Spring or the “Spring Framework” is an open-source app framework that gives infrastructure support to develop Java apps.
It is amongst the most popular Java EE (Java Enterprise Edition_ frameworks).
IT aids the developers in creating high-performing apps with old Java objects.
A framework is a large body that has predefined code.
Developers can add code to the framework to solve any specific domain issue. There are several popular Java frameworks like JSF (Java Server Faces, Struts, Hibernate, Maven, and Spring.
Spring Framework was released in June 2003 by Rod Johnson under Apache 2.0 license. SourceForge hosts it.
Spring Ecosystem Complexity
Many companies use Spring. However, when you go to spring.io, you can see that the Spring universe has 21 different active projects.
Moreover, if you’ve begun programming with Spring in the past couple of years, there’s a high possibility that you directly went into Spring Data or Spring Boot.
In this article, we will, however, be discussing only “Spring Framework”.
It is essential to learn it since it’s the basis of all other projects. Spring Data, Spring Boot, Spring Batch- are all built on top of Spring.
Java programs can be complicated, and they feature multiple heavyweight components. “Heavyweight” means that the components rely on the underlying OS for their properties and appearance.
Spring is taken as a low-cost, secure and flexible framework. It enhances coding efficiency and brings down the overall time of app development since it is lightweight.
It is adept in utilizing system resources and comes with a lot of support.
Spring do away with monotonous configuration work so that the developers can focus on writing business logic instead.
It handles the infrastructure so that the developers can concentrate on the app.
How Does Spring Work?
A web app (layered architecture) generally has three layers-
Presentation Layer / View Layer (UI)
This is the outer-most layer that takes care of the presentation of the content and user interaction.
Business Logic Layer
This is the central layer. It deals with the logic of the program.
Data Access Layer
This is the deepest layer, and it deals with data retrieval from sources.
All these layers are dependent on each other for any app to work.
This implies that the presentation layer talks to the business logic layer, and the business logic layer talk to the data access layer.
Each layer needs dependency for performing its function. Any typical app has thousands of classes and multiple dependencies.
Application code can be tightly coupled without a Spring Framework.
This is, of course, not a good coding practice.
Loose coupling is fitting and quintessential because the loosely coupled components are independent.
Any modification in any one component will not affect the operation of other components.
The core logic of Spring is “dependency injection”.
It is a programming pattern that lets the developers build more decoupled architectures. It implies that the Spring understands the various Java annotations that developers put on top of the classes.