Lazy initialization

By default when the application starts, all beans are initialized @Component, etc.

Spring will create an instance of it and make it available

Instead of creating all beans upfront, we can specify lazy initialization.

A bean will be initialized in the following case
It is needed dependency injection
or it is explicitly requested.
add @Lazy to the given class

Author: Susheel kumar

Leave a Reply

Your email address will not be published. Required fields are marked *