Spring

What is Spring?

The Spring framework is an open-source Java application framework, which is based on two key principles: dependency injection and Inversion of Control. Spring has the ability to autowire the dependency at run time, which allows the developer to write loosely coupled code.

Spring framework uses metadata in the form of xml file or java annotations to create objects and identifies dependencies, thereby producing a ready-to-use application.

A typical web application is divided into three layers: web, business, and the data layer. These layers have objects that collaborate with each other to make the application work. These collaborations are called dependencies. A typical application has a lot of classes and dependencies.

Spring Framework heavily relies on the principle of Loose Coupling, creating objects and populates it with dependencies that are needed. You as programmer only need to tell which objects need to create and what are their dependencies of these objects, and Spring inverts the control of populating the dependencies injecting them into the objects. THis is referred as Inversion of Control (IoC).

In resume, Spring is a powerful dependency injection framework that promotes the development of loosely coupled code.

Latest Java learning