Spring Architecture

Before explaining the architecture of spring and its modules lets have a look at the below diagram fig(a). According to the diagram, Module Y is dependent on Module X. The meaning of Module Y dependent on Module X is that the Module Y internal code is using the classes of Module X.
Spring framework is divided into many modules. The below two diagrams are the architecture diagrams of spring framework. The spring framework is divided into 20 different modules. Some of the main modules are Core, AOP, DAO, ORM, Context, Web and MVC module.

Core Container

Core container consists of Beans, Core, Context, Expression Language modules. IOC and Dependency Injection are covered by Beans and Core modules. The implementation of BeanFactory is provided by Bean module. Context module is dependent on Beans and Core module. The advantage of using context module is it supports internationalization. Expression Language module is used to deal with scoped variables. This Expression Language is more sophisticated than JSP expression Language expressions.

Data Access Integration

This module is used to interact with the database server by using JDBC. When we use spring DAO module, we don't need to write tedious JDBC code. Using JDBC template we can connect to the data base. Spring ORM module supports all the ORM tools. Spring ORM module has given pre-defined classes like hibernate template, JPA template etc. The OXM module provides an abstraction layer that supports Object/XML mapping implementations for JAXB, Castor, XMLBeans, JiBX and XStream. The Java Messaging Service (JMS) module contains features for producing and consuming messages. The Transaction module supports programmatic and declarative transaction management for classes that implement special interfaces and for all your POJOs (plain old Java objects).

Web

This module is divided into 4 sub modules and they are web, web-servlet, web-sturts, web-portlets. Web modile is responsible to create IoC container or Spring Container. Web-Servlet module uses MVC2 architecture. This gives the clear separation of model, view and containers. In this module we can use different view components. For example Jasper Reports, PDF generation, Excel generation etc. Web-Struts module supports integration of struts with spring. Web-portlet is a technology which is used to club multiple projects into a single view.

Test

The Test module supports the testing of Spring components with JUnit or TestNG. It provides consistent loading of Spring ApplicationContexts and caching of those contexts. It also provides mock objects that you can use to test your code in isolation.

No comments:

Post a Comment