Introduction


What is Spring?

Spring framework also known as framework of frameworks, as it provides support to various frameworks such as Struts, Hibernate, EJB, JSF etc.
Spring Framework is a Java platform that provides infrastructure support for developing Java applications.
Spring handles the infrastructure so you can completely focus on your application.
Spring enables you to build applications from "plain old Java objects" (POJOs) and to apply enterprise services non-invasively to POJOs.

Benefits of Spring platform:

1) Makes a Java method executable in database transaction without dealing with transaction APIs.
2) Makes local Java method a remote procedure without dealing with remote APIs.
3) Makes local Java method a management operation without dealing with JMX APIs.
4) Makes local Java method a message handler without dealing with JMS APIs.

Advantages of Spring Framework

1) Loose Coupling
2) Easy to test
3) Lightweight
4) Fast Development
5) Predefined Templates

Main principles on which Spring works:

1. Inversion of control:
It is the mechanism to give control to the container to get instance of object.
It means that instead of creating the object using new keyword, we let the container make object for us.

2. Dependency Injection:
It is the way of injecting (assigning) properties to an object.