Architecture of Spring FrameworkThe Spring framework provides one-stop shop for java based application on all layers (one tier- stand alone java application, web tier- in web application and enterprise tier tier- Enterprise Java Beans). It is modular, means choose spring module based on requirements, It does not inforce to add all the library files in your project classpath. Here are complete module details of the Spring Framework :
All the features of Spring framework are organized into 20 modules. The diagrammatic architecture as follows :
Spring Core :It is core part of Spring and consists of the following modules – Core, Beans, Context and Expression Language. The brief description is as follows :
- Core : It is fundamental module of the framework with IOC and Dependency Injection with singleton design pattern.
- Beans : This module is implementation of the factory design pattern through BeanFactory. The BeanFactory applies IOC to separate the application’s configuration and dependency specification from actual program logic.
- Context : It (ApplicationContext) extends the concept of BeanFactory, adding support for - Internationalization (I18N) messages, Application lifecycle events and Validation. Also includes Enterprise services such as E-mail, JNDI access, EJB integration, Remoting, and Scheduling.
- Expression Language : The Spring3.0 introduces a new expression language – Spring Expression Language (SpEL). It is a powerful expression language based on Java Server Pages (JSP) Expression Language(EL). It is used to write expression language querying various beans, accessing and manipulating their properties and invoking the methods.
Data Access : It is fundamental part of database access layer and consists of the following modules – JDBC, ORM, OXM, JMS and Transaction management module.
The brief description is as follows :
- JDBC: The JDBC modules provides a JDBC-abstraction layer that removes the complexity of the traditional JDBC code and parsing of database-vendor specific error code.
- ORM: The ORM module provide consistency/portability to your code regardless of data access technologies based on object oriented mapping concept like Hibernate, JPA, JDO and iBatis. It provides code without worrying about catching exceptions specific to each persistence technology (ex: SQLException thrown by JDBC API).
- OXM: The OXM introduces in Spring3.0 as separate module. It is used to converts object into XML format and vice versa. The Spring OXM provides a uniform API to access any of these OXM(Castor, XStream, JiBX, Java API for XML and XmlBeans) framework.
- JMS : The JMS module provides by reducing the number of line of code to send and receive messages. The API take car of JMS workflow and exception handling.
- Transaction : The Transaction module supports programmatic and declarative transaction management for POJO classes. All the enterprise level transaction implementation concepts can be implement in Spring.
- Web : This module provides basic web-oriented integration features such as multipart file-upload functionality and the initialization of the IoC container using servlet listeners and a web-oriented application context.
- Web-Servlet : The Web-Servlet module contains model-view-controller (MVC) based implementation for web applications. It provides all other features of MVC including UI tags and data validations.
- Web-Struts: The Web-Struts module contains the support classes for integrating a classic Struts web tier within a Spring application. It contains the classes to integrate Struts1.x and Struts2.
- Web-Portlet : The Web-Portlet module provides the MVC implementation to be used in a portlet environment and mirrors the functionality of Web-Servlet module.
- AOP : It contains API for AOP Alliance-complaint aspect-oriented programming implementations on various layers. You can introduce new functionalities into existing code without modifying it.
- Aspectj : The separate Aspects module provides integration with AspectJ.
- Test : The Instrumentation module provides class instrumentation support and classloader implementations to be used in certain application servers.