"Chapter One" Spring Overview (ii)

Source: Internet
Author: User
Tags aop java se

1.2 Spring Basics

1.2.1 Spring Frame composition

Figure 1-1 Spring Frame composition

Core container : Includes core, Beans, Context, El module.

Core Module : Encapsulates the bottom-most part of a framework dependency , including resource access, type conversions, and some common tool classes.

Beans Module : Provides a basic part of the framework , including inversion control and dependency injection . The Bean Factory is the container core , the essence is the implementation of "Factory design pattern", and no need to implement "single case design mode", single case is completely controlled by the container, and advocate interface-oriented programming, rather than implementation-oriented programming; All application objects and inter-object relationships are managed by the framework, This actually extracts the dependencies between the maintenance objects from the logic of the program, and all these dependencies are maintained by Beanfactory.

Context Module : Based on core and beans, integrates beans module functions and adds resource bindings, data validation, internationalization, Java EE support, container life cycle, event propagation, etc. The core interface is ApplicationContext.

El Module: Provides powerful expression language support, supports access and modification of property values, method invocation, supports access and modification of arrays, containers and indexers, names variables, supports arithmetic and logical operations, supports fetching beans from the spring container, and supports list projection, selection, and general list aggregation.

AOP, aspects modules :

AOP Module : The Spring AOP module provides an aspect-oriented programming (aspect-oriented programming) implementation that conforms to the AOP Alliance specification, providing such as logging , permissions Control , performance statistics , and other common functions and business logic separation technology , and can dynamically add these functions to the required code, so that the professional position, reduce the business logic and common functions of the coupling .

Aspects module: Provides the integration of ASPECTJ, ASPECTJ provides more powerful features than spring ASP.

data Access/integration module : This module includes JDBC, ORM, OXM, JMS, and transaction management.

Transaction Module : This module is used for Spring management transactions , as long as the spring management object can get the benefits of spring management transactions, do not need to do transaction control in code, and support programmatic and declarative management of things .

JDBC Module : Provides a JBDC sample template that uses these templates to eliminate traditional lengthy JDBC coding and the necessary transaction control, and to enjoy the benefits of spring management transactions.

ORM Module : Provides seamless integration with the popular "object-relational" mapping framework , including Hibernate, JPA, Ibatiss, and more. And you can use Spring Transaction management without additional control of transactions.

OXM Module : Provides a object/xml mapping implementation , mapping Java objects to XML data, or mapping XML data to Java objects, Object/xml mapping implementations include JAXB, Castor, XMLBeans and XStream.

JMS module: For JMS (Java Messaging Service), a set of "message producers, message consumers" templates are used to make it easier to use JMS,JMS to send messages between two applications, or distributed systems, for asynchronous communication.

Web/remoting module: The Web/remoting module contains the Web, Web-servlet, web-struts, web-porlet modules.

Web Module : Provides the underlying web functionality. Examples include multi-file uploads , integrated IOC containers , remote process Access (RMI, Hessian, Burlap), and Web service support, and a resttemplate class to provide convenient restful services access.

Web-servlet module: Provides a spring MVC WEB framework implementation. The Spring MVC Framework provides annotation-based request resource injection, simpler data binding, data validation, and a set of very easy-to-use JSP tags that seamlessly collaborate with other spring technologies.

Web-struts module: Provides seamless integration with struts, both struts1.x and struts2.x support

The test module: Spring supports the JUnit and testng test frameworks, and provides additional spring-based testing capabilities, such as simulating the functionality of an HTTP request when testing a Web framework.


1.2.2 Typical application scenarios
Spring can be applied to many scenarios, from the simplest standard Java SE programs to enterprise-class applications that can be built using spring. Here are a few of the more popular scenarios:

Typical Web application scenarios:

Figure 1-2 Web Application Scenario

In a Web application scenario, a typical three-tier architecture:

1.web layer provides page display;

2. Logic layer realizes business logic;

3. Data access layer for data access;

These layer components are managed by spring, enjoy the benefits of spring transaction management, AOP, and the request unique portal is Dispachterservlet, which implements the corresponding request function by mapping the request to the appropriate Web-tier component.

"Chapter One" Spring Overview (ii)

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.