dimanche 1 mars 2015

Why factory bean needs non static method in spring IOC

A factory method of a Bean class should be static whereas a factory methods of a bean present in a factory class should be non static.


Spring IOC throws exceptions if this requirement is not fulfilled.


I am clear on why we need static factory method for a bean as to instantiate a bean using method, it needs to be static.


But why we needs non static method for a factory bean.


Aucun commentaire:

Enregistrer un commentaire