首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > 编程 >

小初学者学 Spring-bean scope (一)

2013-10-08 
小菜鸟学 Spring-bean scope (一)this information below just for study record of mine.默认情况下:Spri

小菜鸟学 Spring-bean scope (一)
this information below just for study record of mine.
默认情况下:Spring 创建singleton bean 以便于错误能够被发现。延迟加载:延迟加载可以使bean 在被需要的时候实例化
Bean Scopesingleton :    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.
小初学者学 Spring-bean scope (一)


prototype:    Scopes a single bean definition to any number of object instancesrequest:         Scopes a single bean definition to the lifecycle of a single HTTP requestsession:  Scopes a single bean definition to the lifecycle of an HTTP Sessionglobal session: Scopes a single bean definition to the lifecycle of a global HTTP Session

this come from http://static.springsource.org/spring/docs/3.2.x/spring-framework-reference/html/beans.html#beans-factory-scopesif there are some copyright or problem happened ,please contact  me.zbwork000@163.com


热点排行