Spring Bean lifecycle

Spring Bean lifecycle

7.357 Lượt nghe
Spring Bean lifecycle
Spring Bean lifecycle is about how a class is instantiated and destroyed. The scope of a bean determines the life span of a class. Request scope is the shortest scope which instantiates and destroys an instance on each page refresh. A session scope retains the bean for the entire time a user is connected to the application. The singleton scope keeps the bean instance alive for the duration of the application on the server.