Main module function of 2.spring

Source: Internet
Author: User

Spring contains approximately 20 modules, including the following sections:

1. Core Container

Core Container (Kernel container) contains core,beans,context and expression language modules

Core and beans are the basic parts of spring, providing the IOC and dependency injection features, the basic concept is beanfactory, which provides a classic implementation of the factory pattern to eliminate the need for a procedural single-column pattern and allows the program to separate dependencies and configurations from logic.

Core: It mainly contains the basic kernel tools of the spring framework, and the core module is the basic kernel of other components.

The Beans:beans module is used by all applications, including access to configuration files, creation and management of beans, and all classes related to IOC/DI operations.

Context: Based on core and Bean, provides a reference similar to Jndi (Java Naming and directory interface, all references to resources outside the system, can be defined and referenced by Jndi Https://www.cnblogs.com/shawnblogs /p/5279733.html), the context inherits the features of beans, provides a large number of extensions to the spring core, adds the support of the State, time propagation, resource loading and EJB and JMX, Where the ApplicationContext interface is the core of the context.

Expression Language: is an extension of unifed expression Language defined in the JSP specification for querying and manipulating objects at run time, supporting setting/getting property values, assigning attributes, calling methods, accessing array contexts, and so on.

2.Data access/integration

JDBC: Provides a JDBC abstraction layer that eliminates lengthy jdbc encodings and resolves database vendor-specific error codes, including all classes that encapsulate JDBC database access

ORM: Object-Relational mapping API, such as JPA, JDO, Hibernate, MyBatis, etc., provides an interaction layer that can be encapsulated using ORM to mix the O/R mappings with all of the spring-provided features.

JMS: Mainly contains some characteristics of manufacturing and consuming information.

Transaction: For transaction management, these transactions must implement a specific interface and are used for all pojo.

3.WEB Module

Web modules provide support for common frameworks such as STRUTS,JSF, and spring can manage these frameworks, inject spring resources into the framework, and insert interceptors before and after these frameworks.

Web: Provides basic web-oriented integration features such as file uploads, the use of servlet listeners to initialize an IOC container, and a web-oriented application context.

Web-servlet: Contains the spring Model-view-controller (MVC) implementation, and the Spring MVC Framework allows for a clear separation between the model-wide code and the Web Forms, and integrates with other features of the spring framework.

Web-struts: Provides support for struts, which is a class that can be integrated with a typical struts web layer in a spring application.

4.AOP

AOP (Aspect oriented programming), which is aspect-oriented programming, can be said to complement and refine OOP (object oriented programming, OO programming). OOP introduces concepts such as encapsulation, inheritance, and polymorphism to create an object hierarchy that simulates a collection of public behavior. However, OOP allows developers to define vertical relationships, but it is not appropriate to define landscape-like relationships, such as logging capabilities. The log code tends to spread horizontally across all object hierarchies, and it has nothing to do with the core functionality of the object it corresponds to, such as the persistence of other types of code, such as security, exception handling, and transparency, the extraneous code scattered around is called crosscutting (cross Cutting), in the OOP design, It leads to a lot of duplication of code and is not conducive to the reuse of individual modules.

AOP technology, on the contrary, uses a technique called "crosscutting" that splits the encapsulated object interior and encapsulates public behavior that affects multiple classes into a reusable module, named "Aspect", or tangent. The so-called "cut-off", simply said to be those unrelated to the business, but for the business module calls together the logic or responsibility to encapsulate, easy to reduce the system duplication of code, reduce the coupling between modules, and conducive to future operability and maintainability.

Using "crosscutting" techniques, AOP divides software systems into two parts: core concerns and crosscutting concerns . The main process of business process is the core concern, and the part that has little relation is the crosscutting concern. One feature of crosscutting concerns is that they often occur in many of the core concerns and are similar everywhere, such as authority authentication, logging, and things. The role of AOP is to separate the various concerns in the system, separating the core concerns from the crosscutting concerns.

Aspects: provides integrated support for ASPECTJ

Instrumentation: Provides class instrumentation support and ClassLoader implementations that make it possible to use on a specific application server.

Join point: In the application it represents a point

Pointcut (pointcut): This is a set of one or more connection points, the notification should be executed

Advice (Notification): This is the method of execution before or after the actual action

Introduction (Reference): reference allows adding a new method or property to an existing class

Target object: An object that is notified by one or more aspects, which is always a proxy object.

Weaving:weaving connects aspects to other application types or objects, and creates a notified object, which can be completed at compile time, class load time, and runtime.

5. Test

The test module supports testing of spring components using JUnit and Testnginx

Main module function of 2.spring

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.