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 {}

最新文章

  1. B树——算法导论(25)
  2. getElementsByTagName() 方法
  3. artdialog
  4. tomcat的CATALINA_HOME可以不用设置
  5. 如何有效使用Project(2)——进度计划的执行与监控
  6. Java基础之访问文件与目录——获取与文件存储有关的信息(GetFileStores)
  7. bzoj 1034 [ZJOI2008]泡泡堂BNB(贪心)
  8. Python设计模式——状体模式
  9. apache asp.net
  10. Chapter 2. Overview gradle概览
  11. maven配置spring mvc+hibernate+spring框架
  12. 列表标题栏添加CheckBox(自定义HanderView的时候实现)
  13. UML九种图-包图、类图
  14. R语言数据分析利器data.table包 —— 数据框结构处理精讲
  15. day16,模块 , 用户管理系统 , 购物车程序 , 分页显示.
  16. js-webpack自动化构建工具
  17. DAY16 模块和包的导入
  18. spring boot 1.x配置,不断完善中
  19. Redis客户端操作之Jedis
  20. 008_Node中的require和import

热门文章

  1. [Windows Server 2008] 404错误设置方法
  2. SweetAlert如何实现点击Confirm之后自动关闭
  3. CREATE DATABASE - 创建新数据库
  4. vue中的main.js打开直接报错问题解决
  5. 算法竞赛入门经典5.2 STL初步
  6. 笔试算法题(27):判断单向链表是否有环并找出环入口节点 & 判断两棵二元树是否相等
  7. Linux系统下设置vi编辑器,tab键为4
  8. 实现基于pam认证的vsftpd
  9. list & dictionary
  10. windows窗口过程函数名词解析