October 2017
Intermediate to advanced
396 pages
10h 2m
English
In Spring, any bean defined with the prototype scope has one instance of the bean created for every time the bean is injected into other collaborating beans. The following figure illustrates the Spring prototype scope:

As you can see in the preceding diagram, an accountRepository class is configured as a prototype bean, and the container creates a brand new instance for each time that bean is injected into other beans.
Read now
Unlock full access