/** * 读取磁盘上的配置文件 */ @Test public void demo3(){ ApplicationContext applicationContext = new FileSystemXmlApplicationContext("c:\\applicationContext.xml"); UserService userService = (UserService) applicationContext.getBean("userService"); userService.sayHello(); }
原始的工厂类BeanFactory
现在的工厂类ApplicationContext