Prototype scope in Spring beans
When you specify a bean as prototype in xml file or through annotation
<bean
id=”myBeanInstance”
class=”com.xyx.PrototypeBeanExample”
scope=”prototype”
autowire=”byName”>
</bean>
it means that every time a request for this bean is made, a new instance is created. If you want to see the illustration
Prototype is meant for beans which hold some state.
The bean lifecycle also changes in prototype bean. From Spring’s doc
Spring does not manage the complete lifecycle of a prototype bean: the container instantiates, configures, decorates and otherwise assembles a prototype object, hands it to the client and then has no further knowledge of that prototype instance

