Spring is an open source framework created to address the complexity of enterprise application development.Spring is one of the most popular frameworks for Java enterprise edition.Spring framework was designed by Rod Johnson. Since then Spring has became alternative technology in java world for EJB model. One of the chief advantages of the Spring framework is its layered architecture, which allows you to be selective about which of its components you use while also providing a cohesive framework for J2EE application development .
Below Spring frameworks has been released till date –
- On Jun 2003– Took license from Apache and First released as a Framework.
- Jan 2006- Won the two awards Jolt productivity award and JAX Innovation Award.
- On Oct 2006– Spring 2.0 released.
- On Nov 2007– Spring 2.5 released.
- On Dec 2009 – Spring 3.0 released.
- On Dec 2011– Spring 3.1 released.
- On Jun 2012– Spring 3.2 released.
- On December 2013– Spring 4.0 released.
- On 31 July 2015– Spring 4.2 released.
- On 10 June 2016– Spring 4.3 released.
- On July 28, 2016 Spring 5 released . New features introduced in Spring 5 are –
- JDK baseline update – JDK 1.8 or above
- Core framework revision.
- Core container updates.
- Functional programming with Kotlin.
- Reactive Programming Model.
- Testing improvements.
- Library support.
- Discontinued support.
Inversion Of Control (IOC)
Basic concept of the Dependency Injection or Inversion of Control is that, we do not need to create the objects, instead just describe how it should be created. No need to directly connect your components and services together in program, instead just describe which services are needed by which components in a configuration file/xml file. The Spring IOC container is then responsible for binding it all up.
It is a composition of structural design patterns, in which for each function of the application there is one, a conditionally independent object (service) that can have the need to use other objects (dependencies) known to it by interfaces. Dependencies are transferred (implemented) to the service at the time of its creation. This is a situation where we introduce an element of one class into another. In practice, DI is implemented by passing parameters to the constructor or using setters. Libraries that implement this approach are also called IoC containers.
Spring is lightweight when it comes to size and transparency. The basic version of spring framework is around 1MB. And the processing overhead is also very negligible.
Spring container manages the life cycle and configuration of application objects.
The Core package is the most import component of the Spring Framework.
This component provides the Dependency Injection features. The BeanFactory provides a factory pattern which separates the dependencies like initialization, creation and access of the objects from your actual program logic.
This package builds on the beans package to add support for message sources and for the Observer design pattern, and the ability for application objects to obtain resources using a consistent API.
One of the key components of Spring is the AOP framework. AOP is used in Spring:
- To provide declarative enterprise services, especially as a replacement for EJB declarative services. The most important such service is declarative transaction management, which builds on Spring’s transaction abstraction.
- To allow users to implement custom aspects, complementing their use of OOP with AOP
The ORM package is related to the database access. It provides integration layers for popular object-relational mapping APIs, including JDO, Hibernate and iBatis.
The Spring Web module is part of Spring?s web application development stack, which includes Spring MVC.
The DAO (Data Access Object) support in Spring is primarily for standardizing the data access work using the technologies like JDBC, Hibernate or JDO.
Spring Web MVC
This is the Module which provides the MVC implementations for the web applications.
This module covers the testing of Spring components with TestNG or JUnit. It balances the consistency of loading in ApplicationContexts and caching of them in Spring. Mock objects are created to test the code in isolation.