# Coding
first step: writing class
Step Two: Writing the configuration file
// a bean tag, on behalf of the factory to make Spring we create an object id: a unique identifier, is based on the object to the future through the factory. class: The fully qualified name of the specified class
//An highlighted block
<bean id = "person1" class = "com.baizhi.person"></bean>
第三步:通过工厂获取对象
```
ApplicationContext context = new ClassPathXMLApplicationContext("文件路径");
XXXservice XS= context.getBean('beanid');
XS.调方法
···
Injection (Injection)
injection manner
1.set injection [focus]
1.1基本类型的注入
八种基本类型以及String类型
<property name="成员变量的名字" value=“给变量赋的值">
1.2 自定义类型注入
//前提是先通过bean创建一个自定义类
<property name="成员变量的名字" ref=“自定义类的beanid">
1.3List类型
1.3.1List里面装的是简单类型
<property name="list的名字">
<list>
<value>元素值</value>
<value>元素值</value>
</list>
</preperty>
1.3.2List里面装的是自定义类型
<property name="lists">
<list>
<ref bean="自定义类的beanid"/>
<ref bean="clazzDAO"/>
<ref bean="clazzDAO"/>
</list>
</property>
1.4Map类型
1.4.1 基本类型
<property name = "map">
<map>
<entry key="k1" value = "v1"/>
<entry key="k1" value = "v1"/>
</map>
</property>
1.4.2自定义类型
<property name = "map">
<map>
<entry (key-ref)/key="k1" value-ref = "自定义beanid"/>
<entry (key-ref)/key="k1" value-ref = "自定义beanid"/>
</map>
</property>