Monday, June 21, 2021

What is bean scope?

- Scope refers to the life cycle of a bean .

-How long does the bean will alive

-How the bean will share

-How many instances will created

By default bean scope is singleton.

Singleton: Spring container will create single instance .All request for the bean will return a shared reference for that bean.


Other scopes:

-Prototype:Create new reference and return it .
 


No comments:

Post a Comment

Clean code chapter 3(Robert C.martin)

  Summary: --------  1. Functions should hardly ever be 20 lines long.  2.Keep blocks (inside if, else, while, for, etc.) short.  Ideally, j...