Spring Bean Scopes in Spring Boot | Singleton & Prototype Scope in Spring | Request & Session Scope

Опубликовано: 11 Июнь 2026
на канале: Dip Developer
208
4

Bean Scopes refers to the lifecycle of Bean that means when the object of Bean will be instantiated, how long does that object live, and how many objects will be created for that bean throughout. Basically, it controls the instance creation of the bean and it is managed by the spring container.

Spring Bean Scopes in Spring Boot | Singleton & Prototype Scope in Spring | Request & Session Scope
--------------------------------------------------------------------------------------------------------
🔗 Related Videos:
Spring Bean Lifecycle:    • Spring Bean Life Cycle | PostConstruct and...  

Spring @Bean Annotation:    • Spring @Bean Annotation with Example | Wha...  

Spring @Component Annotation:    • Spring @Component Annotation Example | Com...  

Dependency Injection using Constructor Injection:    • Constructor Based Dependency Injection Exa...  

Spring IoC Container Explained:    • Spring IoC Tutorial | How Spring IoC Conta...  

Spring Framework Tutorial Playlist:    • Spring Framework Tutorial for Beginners | ...  

--------------------------------------------------------------------------------------------------------
📚 Topics Covered:
Singleton Scope:
Only one instance will be created for a single bean definition per Spring IoC container
The same object will be shared for each request made for that bean.
default scope

Prototype Scope:
spring IOC container will create a new instance of that bean every time a request is made for that specific bean
For each new request a new instance is created

Request Scope:
A new bean will be created for each HTTP request
The lifecycle of a request scoped bean is bound to an HTTP request
That means for each HTTP request, a new bean instance is created and it exists until the completion of the request
@Scope(value = "request", proxyMode = ScopedProxyMode.TARGET_CLASS)
Spring creates a proxy to be injected as a dependency, and instantiates the target bean when it is needed in a request.

Session Scope:
The lifecycle of a session scoped bean is bound to an HTTP session
This is useful for user-specific data like user preferences, user authentication, shopping cart data, etc.

In Spring, the objects that form the backbone of your application and that are managed by the Spring IoC container are called beans. A bean is an object that is instantiated, assembled, and otherwise managed by a Spring IoC container.

#springframework #springbean #springboottutorial
--------------------------------------------------------------------------------------------------------
👉 Don't forget to SUBSCRIBE, LIKE, and SHARE this video if you find it helpful!
-----------------------------------------------------------------------------------------------------------------------------------
🔑 Your Search Queries:
What are the Spring bean scopes?
What is the use of @scope annotation in Spring?
What is @RequestScope in Spring Boot?
What are the different bean scope in Spring Batch?
Spring bean scopes in spring boot
Prototype scope in Spring
Singleton scope in Spring
Spring bean default scope
Spring bean scopes java
Bean scopes in Spring javatpoint
Request scope in Spring
Bean scopes in Spring Boot example
spring bean scopes
spring bean scopes in detail
spring bean scopes selenium express
spring bean scope interview questions
spring bean scopes and life cycle

bean scopes in spring boot
bean scopes
bean scopes in spring framework
bean scopes in spring boot tamil
bean scopes in spring boot in telugu
bean scopes in spring boot telusko
bean scopes in spring in hindi
bean scopes in spring boot code decode
bean scopes in spring boot aktu
bean scope trong spring

--------------------------------------------------------------------------------------------------------
📌 Keywords:
bean scopes in spring framework,bean scopes in spring boot,spring bean scope interview questions,spring bean scopes in detail,spring bean scopes in spring boot,spring boot bean scope example,spring bean scope names,scope of bean in spring boot,what is spring bean scope,bean scopes in spring,singleton scope in spring,singleton and prototype scope in spring in hindi,singleton and prototype scope in spring,when we use singleton and prototype bean scopes in spring,ioc