The Core Container consists of the spring-core, spring-beans, spring-context, spring-context-support, and
spring-expression (Spring Expression Language) modules.
The spring-core and spring-beans modules provide the fundamental parts of the framework, including the IoC and
Dependency Injection features. The BeanFactory is a sophisticated implementation of the factory pattern. It removes the need
for programmatic singletons and allows you to decouple the configuration and specification of dependencies from your actual
program logic.
The Context (spring-context) module builds on the solid base provided by the Core and Beans modules: it is a means to
access objects in a framework-style manner that is similar to a JNDI registry. The Context module inherits its features from the
Beans module and adds support for internationalization (using, for example, resource bundles), event propagation, resource
loading, and the transparent creation of contexts by, for example, a Servlet container. The Context module also supports Java EE
features such as EJB, JMX, and basic remoting. The ApplicationContext interface is the focal point of the Context module.
spring-context-support provides support for integrating common third-party libraries into a Spring application context for
caching (EhCache, Guava, JCache), mailing (JavaMail), scheduling (CommonJ, Quartz) and template engines (FreeMarker,
JasperReports, Velocity).
The spring-expression module provides a powerful Expression Language for querying and manipulating an object graph at
runtime. It is an extension of the unified expression language (unified EL) as specified in the JSP 2.1 specification. The language
supports setting and getting property values, property assignment, method invocation, accessing the content of arrays, collections
and indexers, logical and arithmetic operators, named variables, and retrieval of objects by name from Spring’s IoC container. It
also supports list projection and selection as well as common list aggregations.
翻译:2.2.1核心容器
核心容器由spring-core,spring-beans,spring-context,spring-context-support和spring-expression(Spring表达式语言)模块组
成。
spring-core和spring-beans模块提供了框架的基本部分,包括IoC和依赖注入功能。 BeanFactory是工厂模式的复杂实现。它消除了
对编程单例的需要,并允许您将依赖项的配置和规范与实际程序逻辑脱钩。
上下文(spring-context)模块建立在Core和Beans模块提供的坚实基础上:它是一种以类似于JNDI注册中心的框架样式方式访问对
象的方法。 Context模块从Beans模块继承其功能,并增加了对国际化(例如,使用资源束),事件传播,资源加载以及通过
Servlet容器透明创建上下文的支持。上下文模块还支持Java EE功能,例如EJB,JMX和基本远程处理。 ApplicationContext接口是
Context模块的焦点。 spring-context-support提供了将常见第三方库集成到Spring应用程序上下文中以支持缓存
(EhCache,Guava,JCache),邮件(JavaMail),调度(CommonJ,Quartz)和模板引擎
(FreeMarker,JasperReports,Velocity)的支持。
spring-expression模块提供了一种功能强大的表达式语言,用于在运行时查询和操作对象图。它是对JSP 2.1规范中指定的统一表达
语言(统一EL)的扩展。该语言支持设置和获取属性值,属性分配,方法调用,访问数组,集合和索引器,逻辑和算术运算符,命
名变量以及按名称从Spring的IoC容器中检索对象的内容。它还支持列表投影和选择以及常见的列表聚合。
2.2.2 AOP and Instrumentation
The spring-aop module provides an AOP Alliance-compliant aspect-oriented programming implementation allowing you to
define, for example, method interceptors and pointcuts to cleanly decouple code that implements functionality that should be
separated. Using source-level metadata functionality, you can also incorporate behavioral information into your code, in a manner
similar to that of .NET attributes.
The separate spring-aspects module provides integration with AspectJ.
The spring-instrument module provides class instrumentation support and classloader implementations to be used in certain
application servers. The spring-instrument-tomcat module contains Spring’s instrumentation agent for Tomcat.
翻译:2.2.2 AOP和仪器
spring-aop模块提供了一个符合AOP Alliance要求的面向方面的编程实现,例如,您可以定义方法拦截器和切入点,以干净地解耦
实现应分离功能的代码。 使用源级元数据功能,您还可以以类似于.NET属性的方式将行为信息合并到代码中。
单独的spring-aspects模块提供了与AspectJ的集成。