What is Spring

Spring is an open-source framework, created by Rod Johnson in 2003 and described in his book Expert One-on-One: J2EE Design and Development. It was created to address the complexity of enterprise application development. Spring makes it possible to use plain-vanilla JavaBeans to achieve things that were previously only
possible with EJBs. However, Spring’s usefulness isn’t limited to server-side development.

Any Java application can benefit from Spring in terms of simplicity, testability, and loose coupling.

Benefit of Spring framework:

1. Lightweight:

Spring framework is lightweight because of its POJO(Plain Old Java Object) or POJI(Plain Old Java Interface) implementation. The Spring Framework doesn't force the programmer to inherit any class or implement any interface. That is why it is said non-invasive; objects in a Spring-enabled application typically have no dependencies on Springspecific classes.


2. Inversion of Control:

Spring promotes loose coupling through a technique known as inversion of control (IoC). When IoC is applied, objects are passively given their dependencies instead of creating or looking for dependent objects for  themselves. You can think of IoC as JNDI in reverse instead of an object looking up dependencies from a container, the container gives the dependencies to the object at instantiation without waiting to be asked. The Dependency Injection makes easier to test the application. The EJB or Struts application require server to run the application but Spring framework doesn't require server.



3. Container:

Spring is a container in the sense that it contains and manages the life cycle and configuration of application objects. You can configure how your each of your beans should be created—either create one single instance of your bean or produce a new instance every time one is needed based on a configurable prototype—and how they should be associated with each other.


4. Aspect Oriented:

Aspect Oriented Programming entails breaking down program logic into distinct parts called so-called concerns. The functions that span multiple points of an application are called cross-cutting concerns and these cross-cutting concerns are conceptually separate from the application's business logic. There are various common good examples of aspects like logging, auditing, declarative transactions, security, and caching etc.


5. Framework:

Spring makes it possible to configure and compose complex applications from simpler components. In Spring, application objects are composed declaratively, typically in an XML file. Spring also provides much infrastructure functionality (transaction management, persistence framework integration, etc.), leaving the development of application logic to you.