1、网址
https://spring.io/
https://spring.io/projects/spring-framework


2、Spring 简述
Spring框架是一个基于IOC和AOP的容器框架
1)IOC
Invertion of Control 控制反转.
管理系统中对象的生命周期.目标是解耦.
2)AOP
Aspect Oritend Programming 面向切面编程
解决程序中重复性代码问题.目标是解耦.
3)容器
用于管理对象的 对象.例如:集合
管理对象的生命周期.
实现原理:工厂+XML+反射
4)框架
目的就是将非业务代码进行封装.提高开发效率.
Spring是一个开源框架
Spring为简化企业级开发而生,使用Spring,JavaBean就可以实现很多以前要靠EJB才能实现的功能。同样的功能,在EJB中要通过繁琐的配置和复杂的代码才能够实现,而在Spring中却非常的优雅和简洁。
Spring是一个IOC(DI)和AOP容器框架。
Spring的优良特性
[1]非侵入式:基于Spring开发的应用中的对象可以不依赖于Spring的API
[2]依赖注入:DI——Dependency Injection,反转控制(IOC)最经典的实现。
[3]面向切面编程:Aspect Oriented Programming——AOP
[4]容器:Spring是一个容器,因为它包含并且管理应用对象的生命周期
[5]组件化:Spring实现了使用简单的组件配置组合成一个复杂的应用。在 Spring 中可以使用XML和Java注解组合这些对象。
[6]一站式:在IOC和AOP的基础上可以整合各种企业应用的开源框架和优秀的第三方类库(实际上Spring 自身也提供了表述层的SpringMVC和持久层的Spring JDBC)。
Spring目前的版本http://spring.io/projects

3、Spring 安装包
spring-framework-4.0.0.RELEASE-dist.zip
4、Spring API
1)Javadoc-api
spring-framework-4.0.0.RELEASE\docs\javadoc-api


2)Documentation
spring-framework-4.0.0.RELEASE\docs\spring-framework-reference\htmlsingle


5、Spring 核心包
spring-framework-4.0.0.RELEASE\libs
1)图一

2)图二

6、Spring 约束文件
框架的约束文件有两种,主要是Schema和DTD,Mybatis使用的约束文件就是DTD,现在大部分框架的约束文件使用的都是Schema
spring-framework-4.0.0.RELEASE\schema\aop


7、spring xsd约束文件配置
这里以beans.xsd 为例进行讲解
1)window -> Preferences

2)XML -> XML Catalog -> Add

3)配置spring-beans.xsd
Key: http://www.springframework.org/schema/beans/spring-beans.xsd

4)扩展
(1)DTD类型约束文件
Window->Preferences->XML->XML Catalog->UserSpecified Entries窗口中,选择Add 按纽
在Add XML Catalog Entry对话框中选择或输入以下内容:
Location:D:\soft\dtd\Ibatis\sql-map-config-3.dtd
Key Type: URI
KEY:http://ibatis.apache.org/dtd/sql-map-config-3.dtd
(2)XSD类型约束文件
Window->Preferences->XML->XML Catalog->UserSpecified Entries窗口中,选择Add 按纽
在Add XML Catalog Entry对话框中选择或输入以下内容:
Location:D:\soft\xsd\spring\spring-beans-4.0.xsd
Key Type: Schema Location
KEY:http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
网友评论