Spring 5.0 Cookbook
上QQ阅读APP看书,第一时间看更新

Defining eager and lazy spring beans

At this point, it is clear already how beans are instantiated inside Spring 5.0 containers. The practical definition of Inversion of Control and Dependency Injection design patterns has been established too. Two approaches to implementing a container have been illustrated with the previous recipes. This time we will provide a recipe on how to decide what form of instantiation the beans must undergo in a container.