image.png

    BeanFactory::类似于懒汉式
    ApplicationContext:类似于饿汉式

    开发中使用ApplicationContext更好,因为作为Web开发,在启动服务器时,就创建好对象,这样在之后会更加高效,虽然相对于BeanFactory更加消耗空间。

    image.png

    FileSystemXmlApplicationContext: 是需要带电脑盘符的,也就是其他磁盘中的文件路径
    ClassPathXmlApplicationContext:是直接写src下的类文件的路径