Spring 创建bean的模式

在默认情况下,spring创建bean是单例模式 scope="singleton ",还有一种方式为多例模式【prototype】
     scope
          singleton  默认单例
                     属性是共享的
                     一般情况下,把数据存放在方法中的变量中
          prototype 多例
                    当一个bean是多例模式的情况下,lazy-init为false或者default无效

原文地址:https://www.cnblogs.com/liuwt365/p/4224737.html