Aug 9th, 2012, 03:15 AM
Can prototype beans be defined using Java based configuration ?
Simple question, can it be done ?
Normally with Java based Spring configuration a method defined with @bean returns a new instance of the bean in question, but a prototype bean is different as it's effectively a template for an object rather than something that returns the actual object.
Last edited by Paul Newport; Aug 9th, 2012 at 03:42 AM.
Aug 9th, 2012, 07:56 AM
Yes... The java methods for java config are basically factory methods simply use the @Scope to define it as prototype.