Spring IOC源码中,完整的加载流程是怎样的?
摘要:IOC 的入口说明 ApplicationContext 对象 in short 可以理解为作为具现化的 IOC 的对象根接口, 它是一个重量级的对象, 整个应用期间应该保持单例 官文 Container Overview: https:
IOC 的入口说明
ApplicationContext 对象
in short 可以理解为作为具现化的 IOC 的对象根接口, 它是一个重量级的对象, 整个应用期间应该保持单例
官文 Container Overview: https://docs.spring.io/spring-framework/reference/core/beans/basics.html
Theorg.springframework.context.ApplicationContextinterface represents the Spring IoC container and is responsible for instantiating, configuring, and assembling the beans. The container gets its instructions on the components to instantiate, configure, and assemble by reading configuration metadata. The configuration metadata can be represented as annotated component classes, configuration classes with factory methods, or external XML files or Groovy scripts.
org.springframework.context.ApplicationContext接口代表 Spring IoC 容器,负责实例化、配置和组装 bean。容器通过读取配置元数据来获取实例化、配置和组装组件的指令。配置元数据可以表示为带注解的组件类、具有工厂方法的配置类,或外部 XML 文件或 Groovy 脚本。
Several implementations of theApplicationContextinterface are part of core Spring. In stand-alone applications, it is common to create an instance ofAnnotationConfigApplicationContextorClassPathXmlApplicationContext.
ApplicationContext接口有多个实现 , 是Spring 核心的一部分。在独立应用程序中,通常创建AnnotationConfigApplicationContextorClassPathXmlApplicationContext的实例。
