Spring framework : 6.2.8
Currently, to use the scope name for bean, we can use
BeanDefinition or ConfigurableBeanFactory interfaces which contain
- SCOPE_SINGLETON
- SCOPE_PROTOTYPE
WebApplicationContext interface which contain
- SCOPE_REQUEST
- SCOPE_SESSION
- SCOPE_APPLICATION
Alternatively, we can use @requestScope, @SessionScope and @ApplicationScope
For web socket scope, simply use the string "websocket" as the scope name
================================================================
Problem: The above usage is inconsistent. Why not, make it consistent across the board
Possible Suggestions:
-
BeanDefinition or ConfigurableBeanFactory interface contains all the 6 scopes
-
Introduce @SingletonScope, @PrototypeScope and @WebSocketScope