spring---Part 5

Table of Contents of Series Articles



1. What design patterns are used in the Spring framework?

Simple factory: A factory class dynamically determines which product class should be created based on the parameters passed in.

Spring中的BeanFactory就是简单工厂模式的体现,根据传入一个唯一的标识来获得Bean对象,但是否是
在传入参数后创建还是传入参数前创建这个要根据具体情况来定。

Factory method:

实现了FactoryBean接口的bean是一类叫做factory的bean。其特点是,spring会在使用getBean()调
用获得该bean时,会自动调用该bean的

Guess you like

Origin blog.csdn.net/pleaseprintf/article/details/132769622