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

preview_player
Показать описание
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.

#spring #springboot #annotations
Рекомендации по теме
Комментарии
Автор

Thank you sir for this tutorial. Greetings from Brazil.

erivaldinho