小菜鸟学 Spring-bean scope (一)

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.
小菜鸟学 Spring-bean scope (一)


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



上一篇:How to Build a New Habit: This is Your Strategy Guide


下一篇:WCF-ServiceEndpoint的监听地址与监听模式