Spring Architecture

Spring framework is well-organized architecture made of several well-defined modules and components. Modules are shown in image below.

spring architecture
Spring Architecture

Core Container Module:

The Core module is the most important module of the Spring framework.
Core module has four main components:

  • Core: Core component is responsible for providing dependency injection features. 
  • Beans: Beans components is responsible for providing the BeanFactory pattern. Bean factory creates Bean using configurations provided by developers in XML file. 
  • Context: Context component is responsible for providing extended the capabilities of XML file. This construct the object using base provided by Core and Beans component. It provides extra features such as - Internationalization, resource loading etc.
  • Expression Language: This component provides the basic features of the language such as, arithmetic operators, methods, getters and setters, object creation etc.


Data Access / Integration Module: 

Data Access  layer of the architecture is made of basically five modules. All modules are:

  • JDBC:  Java Database Connection, this module provides abstract layer of JDBC to the application. So, that developers do not have to type complex and redundant database queries.  
  • ORM: Object Relational Mapping, this module provides the abstract layer for integration with different kind of ORM API's such as Hibernate, SimpleORM, iBatis etc.
  • OXM:  Object/XML Mapping, this module provides abstract layer to convert objects into XML format. This module also provides the facility to configure other popular OXM frameworks.
  • JMS: Java Message Service, this module is responsible for producing and consumption of messages. By sending and receiving different kind of messages Spring handles the creation and release of resources. 
  • Transactions: Transaction management module is responsible for handling programmatic and declarative transactions for classes that uses specialized interfaces provided by Java Spring.

Web (MVC / Remoting) Module:

Spring's web layer provides different modules to create MVC based web applications as well as to integrate easily with other MVC frameworks. This layer contains four modules, which are:

  • Web: Web module provides basic web oriented functionality such as file upload, session handling and initialization of IOC container. It also provide components for Spring's remoting functionalities.
  • WebSocket: Web socket module of framework is responsible for two-way communication between client and server. This module is design such that, it can configure easily with different web servers such as Tomcat, Glassfish etc.
  • Servlet: Web servlet module of Spring provides the Model View Controller (MVC) architecture for web applications. This module provides easy separation between domain model classes and web pages of the application and integrates between them.
  • Portlet: Portlet module is basically provides the environment for MVC module to work in a portlet environment. This module has all the functionality same as Web Servlet module.

Other Modules

There are also some other modules in Spring framework. These modules are AOP, Aspects, Messaging and Test.

  • AOP: Aspect Oriented Programming, is the another way of programming the OOP. Main component of the AOP is aspects. Aspects allows developers to handle objects that runs across multiple classes.
  • Messaging:  Messaging module is useful to create message based application. This module works closely with Spring's core module.
  • Test: This module provides Spring to integrate easily with outside testing modules such as Junit. This is useful to test the components of Spring individually or as a whole application.

No comments:

Post a Comment