Spring 底层核心原理

1. Spring framework

1
2
3
4
5
6
AnnotationConfigApplicationContext context=new AnnotationConfigApplicationContext(AppConfig.class);
// 获取 Bean 对象
UserService userService=context.getBean("userService");
// 创建对象
UserService userService=new UserService();

​ context 容器中去获取对象