Sobes.tech
Junior — Middle

What is the frequency of creating beans with the 'prototype' scope in Spring Framework?

sobes.tech AI

Answer from AI

In the Spring Framework, beans with the prototype scope are created anew each time they are requested from the container. This means that each call to ApplicationContext.getBean() for such a bean will return a new instance, unlike a singleton, which returns the same object every time. Therefore, the creation frequency is each request to the container generates a new bean.