this information below just for study record of mine.

默认情况下:Spring 创建singleton bean 以便于错误能够被发现。
延迟加载:延迟加载可以使bean 在被需要的时候实例化

Bean Scope
singleton :    Scopes
a single bean definition to a single object instance per Spring IoC container.
To put it another way, when
you define a bean definition and it is scoped as a singleton, the Spring IoC container creates exactly one instance
of the object defined by that bean definition. This single instance is stored in a cache of such singleton beans, and all
subsequent requests and references
 for that named bean return the cached object.



prototype:    Scopes
a single bean definition to any number of object instances
request:      
  Scopes a single bean definition to the lifecycle of a single HTTP request
session:
 Scopes a single bean definition to the lifecycle of an HTTP Session
global
session
Scopes a single bean definition to the lifecycle of a global HTTP Session




if there are some copyright or problem happened ,please contact  me.
zbwork000@163.com



小菜鸟学 Spring-bean scope (一)的更多相关文章

  1. 小代学Spring Boot之数据源

    想要获取更多文章可以访问我的博客 - 代码无止境. 经过一天对Spring Boot的研究,小代同学已经对Spring Boot框架有了一个大概的认识.并且还创建了一个简单的Spring Boot的W ...

  2. 小代学Spring Boot之集成MyBatis

    想要获取更多文章可以访问我的博客 - 代码无止境. 上一篇小代同学在Spring Boot项目中配置了数据源,但是通常来讲我们访问数据库都会通过一个ORM框架,很少会直接使用JDBC来执行数据库操作的 ...

  3. 小代学Spring Boot之自定义Starter

    想要获取更多文章可以访问我的博客 - 代码无止境. 上一篇小代同学在Spring Boot项目中配置了数据源,但是通常来讲我们访问数据库都会通过一个ORM框架,很少会直接使用JDBC来执行数据库操作的 ...

  4. (转)Spring Bean Scope 有状态的Bean 无状态的Bean

    有状态会话bean   :每个用户有自己特有的一个实例,在用户的生存期内,bean保持了用户的信息,即“有状态”:一旦用户灭亡(调用结束或实例结束),bean的生命期也告结束.即每个用户最初都会得到一 ...

  5. Spring Bean Scope 有状态的Bean 无状态的Bean

    http://blog.csdn.net/anyoneking/article/details/5182164 在Spring的Bean配置中,存在这样两种情况: <bean id=" ...

  6. [跟我学spring][Bean的作用域]

    Bean的作用域 什么是作用域呢?即“scope”,在面向对象程序设计中一般指对象或变量之间的可见范围.而在Spring容器中是指其创建的Bean对象相对于其他Bean对象的请求可见范围. Sprin ...

  7. Spring bean - scope详解

    Scope是定义Spring如何创建bean的实例的. 在创建bean的时候可以带上scope属性,scope有下面几种类型. Singleton 这也是Spring默认的scope,表示Spring ...

  8. 小代学Spring Boot之开篇

    想要获取更多文章可以访问我的博客 - 代码无止境. 前情提要 小代是一名入职不久的程序员,公司同事都亲切的称他小代.有一天小代的老大陈BOSS和小代说,公司后端最近准备换技术框架了. 小代: 换成啥? ...

  9. Spring Bean Scope (作用域)

    singleton: 单例模式,针对每个spring容器,只有一个该类的实例被管理,每次调用此实例都是同一个对象被返回,所以适用于无状态bean.默认情况下,singleton作为spring容器中b ...

随机推荐

  1. centos6.5 redis3 开机自动启动命令设置

    修改redis.conf,打开后台运行选项: # By default Redis does not run as a daemon. Use 'yes' if you need it. # Note ...

  2. Gvim使用

    VIM删除空白行 命令:g/^\s*$/d :g 代表在全文档范围内 ^代表行的开始 \s*代表空白字符 &代表行的结束 d代表删除 用//将3段代码隔开

  3. 【转】【Thread】ReaderWriterLock 读写锁

    ReaderWriterLock类 通常来讲,一个类型的实例对于并行的读操作是线程安全的,但是并行地更新操作则不是(并行地读和更新也不是). 这对于资源也是一样的,比如一个文件.当保护类型的实例安全时 ...

  4. Linux内核

    Linux内核配置.编译及Makefile简述 Hi,大家好!我是CrazyCatJack.最近在学习Linux内核的配置.编译及Makefile文件.今天总结一下学习成果,分享给大家^_^ 1.解压 ...

  5. 使用地址栏访问CXF Webservice写法

    /* * 通过url调用 * http://localhost:8080/EFP/webService/TestWebservice/testOut/arg0/liuyx */ http://loca ...

  6. Integrating JAD decompiler into JDeveloper(转)

    原文地址:Integrating JAD decompiler into JDeveloper In JDeveloper, when debugging or otherwise navigatin ...

  7. memcached工作原理与优化建议

    申明,本文为转载文:http://my.oschina.net/liuxd/blog/63129 工作原理 基本概念:slab,page,chunk. slab,是一个逻辑概念.它是在启动memcac ...

  8. linux实践——简单程序破解

    一.运行login可执行程序,屏幕显示需要输入密码,随便输入一串字符,结果是Drop dead! 二.objdump -d login,对login进行反汇编,找到main函数,找到含有scanf的那 ...

  9. [译]Python编写虚拟解释器

    使用Python编写虚拟机解释器 一.实验说明 1. 环境登录 无需密码自动登录,系统用户名shiyanlou,密码shiyanlou 2. 环境介绍 本实验环境采用带桌面的Ubuntu Linux环 ...

  10. ArrayList List<T> T[] Array

    ArrayList    其实就是一个存储obj列表的类 ArrayList 接受 null 作为有效值并且允许重复的元素. 不保证会对 ArrayList 排序. 在执行需要对 ArrayList ...