Spring Framework
Spring uses various new techniques such as Aspect-Oriented Programming (
AOP), Plain Old Java Object (POJO), and dependency injection (DI), to develop enterprise applications, therebyremoving the complexitiesinvolved while developing enterprise applications using EJB
Spring mainly focuses on
providingvariouswaysto help youmanage your business objects
The Spring framework can be considered as
a collection of sub-frameworks, also called layers, such asSpring AOP, Spring Object-Relational Mapping (Spring ORM).Spring Web Flow, andSpring Web MVC
Spring Framework Features
- Lightweight
The Spring Framework is very lightweight with respect to its size and functionality. It is due to its
POJO implementationwhich doesn’t force to inherit any class or implement any interfaces. - Aspect Oriented Programming(AOP)
It is an important part of Spring Framework.
Aspect Oriented Programmingis used forseparating cross-cutting concerns(for example logging, security etc.) from the business logic of the application. - Transaction Management
This framework provides Java Transaction API (
JTA) forglobal transactionsmanaged by an application server and local transactions managed by using the JDBC, Hibernate, Java Data Objects (JDO), or other data access APIs. - IoC container
Refers to the
core containerthat uses theDI or IoCpattern to implicitly provide anobject referencein a classduring runtime, help manage thelifecycleandconfigurationsof application objects. - Dependency Injection
Dependency Injection is a feature of Spring Framework allows you to develop loosely coupled applications. Therefore, the unit testing of these loosely coupled applications becomes easier.
//without DI public class TextEditor { private SpellChecker spellChecker; public TextEditor() { spellChecker = new SpellChecker(); } } //with DI public class TextEditor { private SpellChecker spellChecker; public TextEditor(SpellChecker spellChecker) { this.spellChecker = spellChecker; } }Spring Framework Architecture

- Spring Core Module
Provides the
IoC container, there are two types of implementations of the Spring container, namely,bean factoryandapplication context. The Bean factory container allows you todecouple the configuration and specification of dependenciesfrom program logic. In the Spring framework, the Bean factory acts as acentral IoC containerthat is responsible forinstantiating application objects. It alsoconfigures and assemblesthedependenciesbetween these objects. - Spring AOP Module
Spring AOP module allows you to implement
concerns or aspectsin a Spring application in Spring AOP, the aspects are the regularSpring beansorregular classesannotated with@Aspectannotation. - Spring ORM Module
Used for
accessing datafrom databases in an application. It provides APIs for manipulating databases withDAO, JDO, Hibernate, and iBatis. - Spring Web MVC Module
It implements the
MVC architecturefor creating Web applications. - Spring Web Flow Module
The Spring Web Flow helps in
defining XML fileorJava Classthatmanages the workflowbetweendifferent pagesof a Web application. - Spring Web DAO Module
Provides
DAO supportby using data access technologies such as JDBC, Hibernate, or JDO. This module introduces aJDBC abstraction layerby eliminating the need for providing tedious JDBC coding. - Spring Application Context Module
Based on the Core module, this module derives its feature from the
org.springframework.beanspackage and also supports functionalities such asinternationalization, validation, event propagation, and resource loading. The Application context implementsMessageSource interfaceand provides themessaging functionalityto an application.
Spring MVC

In Spring MVC, when a
Requestis generated from the browser, it first goes to theDispatcherServletclass (Front Controller), which dispatches the request to aController(SimpleFormController class or AbstractWizardformController class) using a set ofHandler Mappings. The controller extracts and processes the information embedded in a request and sends the result to the DispatcherServlet class in the form of the model object. Finally, the DispatcherServlet class usesViewResolverclasses to send the results to aView, which displays these results to the users.