Spring Source Depth Resolution (i) Spring's overall architecture

Source: Internet
Author: User
Tags aop arithmetic operators to domain

The spring framework is a layered architecture that contains a set of functional elements that are divided into approximately 20 modules, as shown in the following illustration:

Spring Overall architecture diagram


These modules are summarized in the following sections:

(1) Core Container

The core Container package contains core,beans,context,expression language modules.

The Core and beans modules are the basic part of the framework, providing IOC (control reversal) and dependency injection characteristics. The basic concept here is beanfactory, which provides a classic implementation of the factory pattern to eliminate the need for a single case pattern, and really allows you to isolate dependencies and configurations from the logic of your program. The core module consists primarily of the Spring Framework's basic kernel tool classes, and the other components of spring use the classes in this package, and the core module is the base of the other components. Of course, you can also use these tools in your own application system. The beans module is used by all applications to include access to configuration files, creating and managing beans, and all classes related to inversion of control/dependency injection (dependent injection) operations. The context module builds on the core and beans modules and provides a framework-like object access method similar to the Jndi registrar. The context module integrates the features of the beans, provides a large number of extensions to the spring core, and adds support for internationalization (such as resource bindings), event propagation, resource loading, and transparent creation of the context. The context module also supports some of the features of Java EE, such as EJB (Java Enterprise Bean), JMX (Java Management Extensions, Java Management Extensions is a framework for embedding management functions for applications, devices, systems, etc.) And the basis of remote processing. The ApplicationContext interface is the key to the context module. The Expression Language module provides a powerful expression language for querying and manipulating objects at run time. It is an extension of the UNIFED expression language defined in the JSP2.1 specification. The language supports setting/getting the value of the property, the allocation of the property, the invocation of the method, accessing the array context (accession of arrays), the container and indexer, the logic and arithmetic operators, named variables, and retrieving objects from the spring's IOC container by name. It also supports list projection, selection, and general list aggregation.

(2) Data access/integration.

The Data access/integration layer contains JDBC,ORM,OXM,JMS and transaction modules, where the JDBC module provides a JDBC abstraction layer that eliminates lengthy jdbc encodings and resolves database vendor-specific error codes. This module contains all the classes that spring encapsulates for JDBC data access. The ORM (Object Relational Mapping) module provides an interaction layer for the popular object-relational mapping APIs, such as Jpa,jdo,hibernate,ibatis. With an ORM package, you can mix the O/R mappings with all of the features that spring provides. Simple declarative transaction management, as mentioned earlier.

The Spring framework inserts several ORM frameworks, providing an ORM object-relational tool, including Jdo,hibernate and Ibatissqlmap. All of these conform to spring's common transaction and DAO exception hierarchy. The OXM module provides an abstraction layer for object/xml mapping implementations, Object/xml mapping implementations include JAXB (JAXB is able to use Jackson's support for JAXB annotations (jackson-module-jaxb-annotations , which facilitates the generation of XML, and also facilitates the generation of JSON, which can better flag the Java classes that can be converted to JSON objects. JAXB allows Java people to map Java classes to XML representations, commonly used annotations include: @XmlRootElement, @XmlElement, etc.), Castor (Castor Http://castor.exolab. org/) is an open-source software that automatically binds Java objects and XML. It can be bound between Java objects, XML literals, SQL data tables, and LDAP directories), XMLBeans (one of the most powerful features of XMLBeans 1.0.3 is the ability to customize code generation by providing configuration files), JiBX (from Java code to XML), and XStream (conversion java,xml). The JMS (Java messaging Service) module contains a number of features for manufacturing and consuming messages. The transaction module supports programmatic and declarative transaction management, which must implement specific interfaces and apply to all Pojo (which is actually ordinary JavaBeans).

(3) Web.

The Web context module is built on top of the application context module, providing a context for web-based applications. So the spring framework supports integration with Jakarta struts. The Web module also simplifies the work of processing multiple-part requests and binding request parameters to domain objects. The WEB layer contains web,web-servlet,web-struts and Web-porlet modules, as specified below. Web module: Provides a foundation for web-oriented integration features. For example, multiple file uploads, using servlet listeners to initialize the IOC container and a web-oriented application context. It also contains the relevant parts of the web in spring remote support. Web-servlet module Web.servlet.jar: This module contains the implementation of Spring's Model-view-controller (MVC). Spring's MVC framework allows for a clear separation between model-scoped code and Web Forms, and integrates with other features of the spring framework. Web-struts Module: This module provides support for struts, enabling dogs to integrate with a typical struts web layer in spring applications, noting that the support is deprecated in Spring3.0. Web-porlet module: Provides an implementation of MVC for portlet environments and Web-servlet modules.

(4) AOP.

The AOP module provides an implementation of aspect-oriented programming that conforms to the AOP Federation standard, allowing you to define examples such as method interceptors and pointcuts. This separates the logical code and reduces the coupling between them. Using the Source-level metadata feature, you can also incorporate a variety of behavioral information into your code, which is a bit like. NET technology in the concept of attribute.

By configuring the management features, the SPRINGAOP module integrates the aspect-oriented programming functionality directly into the spring framework, so it is easy to support AOP for any object managed by the spring framework. The spring AOP module provides transaction management services for objects in a spring-based application. By using spring AOP, you can integrate declarative transaction management into your application without relying on EJB components. The aspects module provides integrated support for the ASPECTJ (a facet-oriented framework that extends the Java language). The instrumentation module provides class instrumentation support and ClassLoader implementations, which can be used on specific application servers.

(5) Test

The test module supports testing the spring component with JUnit and testng.




Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.