Spring Modules

Spring framework consists of about 20 modules. These modules are Core, Beans, Context, Expression Language (EL), AOP, Aspects, Instrumentation, JDBC, ORM, OXM, JMS, Transaction, Web, Servlet, Struts etc. These modules are grouped into Test, Core Container, AOP, Aspects, Instrumentation, Messaging, Data Access / Integration, and Web.

Spring Modules

Core Container

This layer provides IOC container that manages bean life cycle. It provides dependency injection mechanism. This layer will be used by all other spring modules and groups. It consists of the Core, Beans, Context, and Expression Language modules.

  • Core and Beans modules provides basic feature of bean life cycle management and dependency injection. It provides BeanFactory IOC container.
  • Context module is built over Core and Beans. It inherits the features of bean module and provides application context container. It supports internationalization (i18n), event propagation, EJB, JMX,
  • Expression Language module provides expression language for querying and manipulating object graph from IOC container. It is an extension of the unified expression language (unified EL) as specified in the JSP 2.1 specification. It is used to get and set properties, method invocation, access collection, and logical/arithmetic operations.

Data Access/Integration

This layer is used to integrate database ORM frameworks, object to XML binding frameworks, massaging services and handling database transaction s. The Data Access/Integration layer consists of JDBC, ORM, OXM, JMS and Transaction modules.

  • JDBC module provides an abstraction layer of jdbc. Abstraction layer removes the dependency of core api call of jdbc and database vender specific exception handling.
  • ORM module integrations spring with popular object-relational mapping tools. Popular ORM tools are JPA, JDO, Hibernate, and iBatis. It provides simple declarative transaction handling.
  • OXM module provides abstraction layer to support Object/XML mapping implementations for JAXB, Castor, XMLBeans, JiBX and XStream.
  • Java Messaging Service (JMS) module provides features for producing and consuming messages.
  • Transaction module supports programmatic and declarative transaction management.

Web

This layer is used to integrate spring with web application and its framewoeks. Web layer consists of the Web, Web-Servlet, Web-Struts, and Web-Portlet modules.

  • Web module integrates spring with a web application. It initializes application context container for web application, It provides basic web application features like multipart file-upload.
  • Web-Servlet module contains model-view-controller (MVC) implementation of spring for web applications. Spring MVC framework provides a clean separation between domain model code and web forms, and integrates with all the other features of the Spring Framework.
  • Web-Struts module integrates spring container with struts framework.
  • Web-Portlet module provides the MVC implementation to be used in a portlet environment.

AOP and Instrumentation

  • AOP module provides aspect-oriented programming implementation where you can use advices, pointcuts etc. to decouple the code.
  • Aspects module provides integration with AspectJ.
  • Instrumentation module provides class instrumentation support and classloader implementations to be used in certain application servers.

Messaging

  • Spring-Messaging module with key abstractions from the Spring Integration project such as Message, MessageChannel, MessageHandler, and others to serve as a foundation for messaging-based applications.
  • The module also includes a set of annotations for mapping messages to methods, similar to the Spring MVC annotation based programming model

Test

Test module supports testing of spring components with JUnit or TestNG. It provides consistent loading of application context testing. It also provides mock objects that you can use to test your code in isolation.

Spring Boot

Spring Boot is built on top of spring framework, it makes easy to run and configure both simple and web applications.

Spring Boot is a combination of Spring framework and Servers like Tomcat, JBoss, etc. Now there is no need to create XML configuration (Deployment Descriptor) file. In other words we can start spring boot application with minimal spring configuration.

Spring Security

To create secure Java Enterprise applications Spring Security provides various security features. Authentication and authorization are two major features of spring security.

Authentication is the process where authorized/registered user can only access the application.

Authorization is the process to allow authority to perform actions in applications.

Spring Batch

Spring Batch is an open source framework for batch processing.It executes series of jobs. Spring Batch provides classes and APIs to read/write resources, transaction management, job processing statistics, job restart and partitioning techniques to process high-volume of data.

Spring Cloud

Spring Cloud is module of spring framework, which allows developers to quickly develop cloud based allocation in distributed systems. It also provides facilities to use cloud based services in application.

Spring Cloud provides tools for developers to build some of the common patterns in distributed systems quickly. For example, configuration management, service discovery, circuit breakers, intelligent routing, micro-proxy, a control bus, one-time tokens, global locks, leadership election, distributed sessions, cluster state.

Spring Microservices

Microservices are a suite of small services that work together to build an application. It helps to break large application into small logical independent application. If we change services of one application it does not affect services of another application.

These services communicate to each other by using light weight protocols like HTTP, REST etc.