Before going to spring framework let’s understand what is a Framework?
A Framework is a collection of predefined libraries which provides solution to a technical problem. It means we can directly add these libraries to use in our application to overcome those problems. In short a framework is a collection of various predefined Classes, Packages, Interfaces and Methods for some technical problem.
Now, what is Spring?
Spring is developed by Rod Johnson. It is a light weight framework used to develop loosely coupled enterprise applications. It is also termed as “framework of frameworks” because it provides support to other framework like struts, Hibernate, Topestry etc.
Spring consists of various modules and provides the facility to use only those modules which you need without bringing others. Every module provides solution for some specific problems.
Advantages of Spring Framework
• It is a powerful framework and resolves many common problems in Java EE.
• It enables developers to use POJO and POJI model.
• It allows you to only access those modules which you want.
• Supports XML and annotation based configuration.
• Provides good support to enable loose coupling using IoC and DI.
• Provides easy to test environment for testing.
Spring Architecture consists of around 20 modules. You can use them according to your choice. Below is the diagrammatic representation of it.
Core Container of Spring Framework contains various modules such as core, Bean, context, SpEL.
Core: It provides you fundamentals of spring framework including IOC and DI.
Bin : It is used for creating and managing spring-beans.\
Context : It is based on Bean and Core modules and allows you to access any object that is defined in settings. The key element of context module is ApplicationContext interface.
SpEL : It provides you a powerful expression language for manipulating objects.
Spring web container includes web, Web-MVC, Web-socket and web-portalet
Web : It provides you functions such as creating web applications, downloading file, web oriented integration features.
Web-MVC : It contains multiple views Controller implementation.
Web-socket : It provides support for communication between client and server in a web application using socket
Data access it provides various module for data access and integration it includes JDBC, ORM, OXM, JMS and transaction module.
JDBC : It provides you all the functionalities related to jdbc without writing heavy codes as we normal JDBC programs.
ORM : It provides the integration layer for ORM API’s.
OXM : It provides support to link Object-XML, XML-Bean.
JMS : It provides support for Creating, sending and receiving messages.
Transactions : It supports transaction management for classes that implements certain special methods.
AOP : It provides implementation for Aspect Oriented Programming.
Aspect : It provides integration with AspectJ framework.
Instrumentation : It provides support to class instrumentation and class loader.
Messaging : Messaging module of spring framework provides support for STOMP.
Test : It provides testing support using testNG or Junit.