下文笔者讲述Spring中各模块的功能简介说明,如下所示
Spring简介
<pre style="word-wrap: break-word; font-size: 14px; background: rgb(237, 237, 237); font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial; color: red; font-weight: bold;">spring是一个java开发框架
spring中包含很多模块,每一个模块都包含不同的功能
我们在使用spring时,只需引入相应的模块,即可使用spring中的功能
spring 中各模块如下所示
</pre>
[图片上传失败...(image-e90758-1665279248413)]
spring核心模块
<pre style="word-wrap: break-word; font-size: 14px; background: rgb(237, 237, 237); color: rgb(85, 85, 85); font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial;">spring核心模块有:
spring core,spring bean,spring context,spring Expression
</pre>
spring核心模块的功能
<pre style="word-wrap: break-word; font-size: 14px; background: rgb(237, 237, 237); font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial; color: blue; font-weight: bold;">spring core:
核心模块提供框架的基本组成部分,包含IOC和依赖注入功能
spring bean:
Bean模块提供BeanFactory,是工厂模型复杂实现
spring context:
上下文模块建立在有核心和Bean模块提供的坚实的基础上
用于访问定义和配置的任何对象的媒介
在spring context中AppliactionContext接口是一个非常重要的上下文接口
spring experssion
表达式语言模块为spring运行时
提供查询和操作一个对象的强大的表达式语言
</pre>
spring数据访问/集成
<pre style="word-wrap: break-word; font-size: 14px; background: rgb(237, 237, 237); color: rgb(85, 85, 85); font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial;">数据访问/集成包含JDBC.ORM.OXM.JMS和事务处理模块,他们的细节如下
</pre>
spring jdbc模块
<pre style="word-wrap: break-word; font-size: 14px; background: rgb(237, 237, 237); color: rgb(85, 85, 85); font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial;">JDBC模块提供了删除冗余的JDBC相关编码的JDBC抽象层。
</pre>
spring orm模块
<pre style="word-wrap: break-word; font-size: 14px; background: rgb(237, 237, 237); color: rgb(85, 85, 85); font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial;">ORM模块为流行的对象关系映射API,包含JPA,JDO,Hibernate和IBatis,提供了集成层。
</pre>
spring oxm模块
<pre style="word-wrap: break-word; font-size: 14px; background: rgb(237, 237, 237); color: rgb(85, 85, 85); font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial;">OXM模块提供了抽象层,它支持对JAXB,Castor,XMlBeans,JiBx和XStream的对象/xml映射实现。Java消息服务JMS模块包含生产和消费的信息的功能。
</pre>
spring 事务模块
<pre style="word-wrap: break-word; font-size: 14px; background: rgb(237, 237, 237); color: rgb(85, 85, 85); font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial;">事务模块为实现特殊接口的类及所有的POJO支持编程式和声明式事务管理。
</pre>
Web
<pre style="word-wrap: break-word; font-size: 14px; background: rgb(237, 237, 237); color: rgb(85, 85, 85); font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial;">Web层由web,web-mvc,web-Scoket和web-Porlet组成。
Web模块提供了基本的面向we的集成思想,例如多个文件上传的功能和使用servlet监听器和面向web应用程序的上下文初始哈市IOC容器
Web-MVC模块包含spring的模块视图-控制器-(MVC)实现了web应用程序
Web-Socket模块为WebSocket-based提供了支持,而且在web应用程序中提供了客户端和服务端之间通信的两种方式。
Web-Porlet模块提供了portlet环境中实现mvc,并且反映了web_socket模块的功能。
</pre>
Spring 其他模块
<pre style="word-wrap: break-word; font-size: 14px; background: rgb(237, 237, 237); color: rgb(85, 85, 85); font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial;"> Aop,Aspects,Instrumentation,web和测试模块
Aop模块提供了面向切面的编程实现,允许你定义拦截器和切入点对代码进行干净的解耦,他实现了应该的分离的功能。
Aspects模块提供了与AspectJ的集成,这是一个功能强大并且成熟的面向切面编程的框架
Instrmentation模块在一定的应用程序中提供了类instrumentation的支持和类加载器的实现
Messaging模块为Stomp提供了作为应用程序中webSocket自协议的使用,他支持一个注解编程模型,他是为了选路和处理来自webSocket客户端的Stomp信息
测试模块支持对具有Junit和TestNG框架的spring组件的测试</pre>
网友评论