Spring & Spring Boot Annotations Series - #8 - @Scope Annotation | Singleton and Prototype Scopes

Описание к видео Spring & Spring Boot Annotations Series - #8 - @Scope Annotation | Singleton and Prototype Scopes

Hi, welcome to Spring & Spring Boot Annotations Series. In this video, we will learn how to use @Scope annotation to define the scope of the bean.

@Scope annotation is used to define the scope of the bean

We use @Scope to define the scope of a @Component class or a @Bean definition.

Singleton: only one instance of the bean is created and shared across the entire application. This is the default scope.

Prototype: a new instance of the bean is created every time it is requested.

Complete playlist:    • Spring & Spring Boot Annotations  

#spring #springboot #annotations

Комментарии

Информация по комментариям в разработке