Spring中ApplicationContext如何创建Bean?
When we create an ApplicationContext in Spring, such as: ApplicationContext ctx = new AnnotationConfigApplicationContext(AppConfig.class); Spring performs the following steps behind the scenes...
在Spring中,创建ApplicationContext时,首先解析配置类生成BeanDefinition并注册到BeanFactory。接着通过refresh()方法修改和初始化Bean,最后实例化Bean并注入依赖,存入单例缓存。
