Spring framework architecture
Spring has a layered architecture which consists of various modules. All the modules are built on top of the core container and are mostly independent. This way, the developer is free to use only the modules that are needed for the particular requirements. The modules in Spring framework are grouped into Core Container, Data Access/Integration, Web, AOP (Aspect Oriented Programming), Instrumentation, and Test.
** UPDATE: Spring Complete tutorial now available here.
- Core and Beans provide the most fundamental part of the framework including IOC container and Dependency Injection(DI)
- Context provides a means to access objects in a framework-style manner. It inherits its features from the Beans module and adds support for internationalization (using, for example, resource bundles), event-propagation and resource-loading,
- Expression Language(EL) supports setting and getting property values, property assignment, method invocation, accessing the context of arrays, collections and indexers, logical and arithmetic operators, named variables and retrieval of objects by name from Spring’s IoC container.
- JDBC[Java DataBase Connectivity] provides a JDBC abstraction layer
- ORM[Object Relational Mapping] is responsible for Database access and related activities. It provides integration layers for popular object-relational mapping APIs, including JDO, Hibernate
- OXM [Object/XML Mapping] provides an abstraction layer that supports Object/XML mapping implementations for JAXB, Castor, XMLBeans, JiBX and XStream.
- JMS [Java Messaging Service] provides features for creating and consuming messages.
- Transaction provides support to programmatic and declarative transaction management for classes that implement special interfaces and for all the POJOs (Plain Old Java Objects)
It is used as a replacement for EJB container and is much simpler than EJBs. The most important service provided by AOP is declarative transaction management. The AOP implementation allows the developer to define point-cuts and method interceptors to keep the ‘concerns’ apart. This clearly enables decoupling the functionality of the code that needs to be separated.
It provides class instrumentation support and also class loader implementations to be used in a certain application servers. It also exposes performance and resource utilization metrics for the Spring container and thus facilitates run time control over the spring container.
The WEB module consists of Web, Web-servlet, Web-porlet, Web-struts as sub-modules.
- Web provides the basic web-oriented integration features such as multi part file upload functionality , a web-oriented application context and the initialization of the IoC using servlet listeners and.
- Web-Servlet contains Spring’s MVC for the web applications. It is a part of Spring’s web application development stack.
- Web-Struts helps in integrating a Struts web tier within a Spring application.
- Web-Portlet typically mirrors the functionality of the web-servlet module. It provides the MVC implementation for portlet environment.
Supports testing of Components using Junits.