Skip to content
Merged

2 #3

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
30 changes: 30 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,36 @@ ppt //存放上课使用的ppt文件,已转换成对应的pdf,避免不同
55 js介绍及内置功能函数、数据类型、变量 2019/12/7 15:00-17:00
56 js的变量及运算符 2019/12/7 20:00-22:00
57 js的流程控制语句 2019/12/8 15:00-17:00
58 js的函数基本使用 2019/12/14 15:00-17:00
59 js的数组和字符串的基本使用 2019/12/14 20:00-22:00
60 dom操作、常用方法、事件绑定 2019/12/15 15:00-17:00
61 echarts和js对象、函数上下文 2019/12/28 15:00-17:00
62 js构造函数、js原型链、继承及实战案例 2019/12/28 20:00-22:00
63 jquery简介、选择器、常用方法 2019/12/29 15:00-17:00
64 jquery的节点关系及函数操作 2020/1/4 15:00-17:00
65 jquery轮播图及函数库介绍 2020/1/4 20:00-22:00
66 Http协议、php的基本介绍 2020/1/5 15:00-17:00
67 ajax基本原理及使用 2020/1/11 15:00-17:00
68 ajax的接受数据的方式及三级联通案例 2020/1/11 20:00-22:00
69 vue框架的介绍及使用 2020/1/12 15:00-17:00
70 vue框架的调色板、属性值监听、百度预搜索、函数 2020/1/18 15:00-17:00
71 vue框架的生命周期、axios、拉取服务器数据,组件使用 2020/1/18 20:00-22:00
72 vue框架的高阶使用 2020/1/19 15:00-17:00
73 Spring框架的介绍及使用 2020/2/8 15:00-17:00
74 SpringIOC容器的配置使用1 2020/2/8 20:00-22:00
75 SpringIOC容器的配置使用2 2020/2/9 15:00-17:00
76 SpringIOC容器的注解使用 2020/2/15 15:00-17:00
77 SpringAOP的引入及配置使用 2020/2/15 20:00-22:00
78 SpringAOP的详细讲解 2020/2/15 15:00-17:00
79 SpringAOP的声明式事务控制 2020/2/22 15:00-17:00
80 SpringAOP声明式事务及源码讲解 2020/03/07 15:00-17:00
81 Spring源码讲解 2020/03/07 20:00-22:00
82 Spring源码讲解 2020/03/08 15:00-17:00
83 动态代理 2020/03/08 20:00-22:00
84 springmvc简单介绍及使用 2020/03/14 15:00-17:00
85 Springmvc的使用1 2020/03/14 20:00-22:00
86 Springmvc的使用2 2020/03/15 15:00-17:00
87 Springmvc的使用3 2020/03/15 20:00-22:00
......持续更新
```

Binary file added database/image/spi.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion database/note/Java SPI机制详解.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
SPI 全称为 (Service Provider Interface) ,是JDK内置的一种服务提供发现机制。SPI是一种动态替换发现的机制, 比如有个接口,想运行时动态的给它添加实现,你只需要添加一个实现。我们经常遇到的就是java.sql.Driver接口,其他不同厂商可以针对同一接口做出不同的实现,mysql和postgresql都有不同的实现提供给用户,而Java的SPI机制可以为某个接口寻找服务实现。
```

![](C:\Users\63198\Desktop\SPI.jpg)
![](../image/spi.jpg)

​ 如上图所示,接口对应的抽象SPI接口;实现方实现SPI接口;调用方依赖SPI接口。

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Large diffs are not rendered by default.

Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">

<!--bean标签表示要创建的bean对象
id:bean的唯一标识,为了跟其他的bean区分
class:表示要创建的bean的完全限定名
-->
<bean id="person" class="com.mashibing.bean.Person">
<!--给属性赋值使用property标签
name:表示属性的名称
value:表示具体的属性值
-->
<property name="id" value="1"></property>
<property name="name" value="zhangsan"></property>
<property name="age" value="20"></property>
<property name="gender" value="男"></property>
</bean>
</beans>
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="spring-beans-5.2.3.RELEASE" level="application" />
<orderEntry type="library" name="commons-logging-1.2" level="application" />
</component>
</module>
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
package com.mashibing.bean;

public class Person {
private int id;
private String name;
private int age;
private String gender;

public Person() {
System.out.println("person被创建");
}

public int getId() {
return id;
}

public void setId(int id) {
this.id = id;
}

public String getName() {
return name;
}

public void setName(String name) {
this.name = name;
}

public int getAge() {
return age;
}

public void setAge(int age) {
this.age = age;
}

public String getGender() {
return gender;
}

public void setGender(String gender) {
this.gender = gender;
}

@Override
public String toString() {
return "Person{" +
"id=" + id +
", name='" + name + '\'' +
", age=" + age +
", gender='" + gender + '\'' +
'}';
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package com.mashibing.test;

import com.mashibing.bean.Person;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

//容器中的person对象是什么时候创建的?
//容器中的对象在容器创建完成之前就已经把对象创建好了
public class MyTest {
public static void main(String[] args) {
/*
* applicationContext:表示IOC容器的入口,想要获取对象的话,必须要创建该类
* 该类有两个读取配置文件的实现类
* ClassPathXmlApplicationContext:表示从classpath中读取数据
* FileSystemXmlApplicationContext:表示从当前文件系统读取数据
*
*
* * */
ApplicationContext context = new ClassPathXmlApplicationContext("ioc.xml");
//获取具体的bean实例对象,需要进行强制类型转换
// Person person = (Person) context.getBean("person");
//获取对象的时候不需要强制类型转换
// Person person = context.getBean("person", Person.class);
// System.out.println(person);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">

<!--bean标签表示要创建的bean对象
id:bean的唯一标识,为了跟其他的bean区分
class:表示要创建的bean的完全限定名
-->
<bean id="person" class="com.mashibing.bean.Person">
<!--给属性赋值使用property标签
name:表示属性的名称
value:表示具体的属性值
-->
<property name="id" value="1"></property>
<property name="name" value="zhangsan"></property>
<property name="age" value="20"></property>
<property name="gender" value="男"></property>
</bean>
</beans>

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading