Grokking Java Interview Questions
Vote

0% completed

​

Bean Scopes and Lifecycle

A grocery store application contains objects that should live for different lengths of time:

  • The Stock object should exist once, and every part of the application should use it.
  • A Cart should be new each time a checkout begins.
  • The details of the current customer should exist for one HTTP request and then disappear.

Spring creates all three, and one setting on each bean selects the rule. This setting is the scope of the bean

.....

.....

.....

Like the course? Get enrolled and start learning!

Reading Progress

0%


Vote for new content