标签:single can customers actor div cto ice The sprint
We can define a class to be Singleton or Prototype. If the class was defined as Prototype, then everytime when we use new keyword, it will create a new instance.
// Singleton @Service("customerService") @Scope(ConfigurableBeanFactory.SCOPE_SINGLETON) public class CustomerServiceImpl implements CustomerService {} // Prototype @Service("customerService") @Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE) public class CustomerServiceImpl implements CustomerService {}
[Sprint] Bean Scope Singleton cs Prototype
标签:single can customers actor div cto ice The sprint
原文地址:https://www.cnblogs.com/Answer1215/p/9573585.html