Spring Bean
Last updated
Was this helpful?
Last updated
Was this helpful?
Scopes
defines the scope of the bean object (singleton, prototype, etc). Spring supports five scopes, three of them are available only with the web apps.The default scope is “singleton”, while the “prototype” scope will create a new object every time we instantiate an object.
. So, lazy instantiation is only useful when the scope is singleton.
Lifecycle of the bean is as the following:
Bean Instantiated -> Dependencies Injected -> Internal Processing -> Custom Init and destroy method(hooks) -> Bean is ready for use.