## 接口的使用
org.springframework.beans.factory.ObjectFactory

- 使用ObjectFactory的程序包
  程序包 | 说明
  --- | ---
  org.springframework.beans.factory | The core package implementing Spring's lightweight Inversion of Control (IoC) container.
  org.springframework.beans.factory.config | SPI interfaces and configuration-related convenience classes for bean factories.
  org.springframework.beans.factory.support | Classes supporting the `org.springframework.beans.factory` package.

- - ### org.springframework.beans.factory中ObjectFactory的使用

    org.springframework.beans.factory中ObjectFactory的子接口
    限定符和类型 | 接口和说明
    --- | ---
    `interface` | `ObjectProvider<T>` A variant of `ObjectFactory` designed specifically for injection points, allowing for programmatic optionality and lenient not-unique handling.

  - ### org.springframework.beans.factory.config中ObjectFactory的使用

    返回ObjectFactory的org.springframework.beans.factory.config中的方法
    限定符和类型 | 方法和说明
    --- | ---
    `protected ObjectFactory<Object>` | ObjectFactoryCreatingFactoryBean.`createInstance()`

    参数类型为ObjectFactory的org.springframework.beans.factory.config中的方法
    限定符和类型 | 方法和说明
    --- | ---
    `Object` | Scope.`get(String name, ObjectFactory<?> objectFactory)` Return the object with the given name from the underlying scope, `creating it` if not found in the underlying storage mechanism.

  - ### org.springframework.beans.factory.support中ObjectFactory的使用

    参数类型为ObjectFactory的org.springframework.beans.factory.support中的方法
    限定符和类型 | 方法和说明
    --- | ---
    `protected void` | DefaultSingletonBeanRegistry.`addSingletonFactory(String beanName, ObjectFactory<?> singletonFactory)` 该方法用于把早期对象包装成一个ObjectFactory 暴露到三级缓存中 用于将解决循环依赖...
    `Object` | DefaultSingletonBeanRegistry.`getSingleton(String beanName, ObjectFactory<?> singletonFactory)` 获取单例对象(该流程用于触发构建bean)