Patterns
- Scope != Pattern
- Spring Uses Them
- Course(s): Design Patterns in Java
----------------------------------------------------------------
Scopes
- Valid in any configuration
Singleton
Prototype - Valid only in web-aware Spring projects
Request
Session
Global
-------------------------------------------------------------------
Singleton
- One Instantiation
- Default Bean Scope
- Single instance per Spring container
---------------------------------------------------------------------
Singleton - Java Config
- @Scope
- Requires AOP jar
Demo
applicatonContext.xml
default: singleton
prototype
Using a Constant Demo
-------------------------------------------------------------------------------
Singleton - XML Config
- scope="singleton"
---------------------------------------------------------------------------------
Prototype
- Per request
- Guaranteed unique
- Opposite of Singletion
-------------------------------------------------------------------------
Web Scopes
- Introduction to Spring MVC course
- Request
- Session
- GlobalSession
----------------------------------------------------------------------------------------------------------------
Summary
- Scopes
Singleton
Prototype - Web Scopes
Request
Session
GlobalSession
------------------------------------------------------------------
Properties
https://blog.csdn.net/u012596785/article/details/79865454