samedi 14 mars 2015

Spring Auto Scanning Components Vs Bean Declaration?

In all the past projects i have worked till now and they were all products, beans are declared through XML bean configuration file, so that Spring container can detect and register our beans or components.


But there is another way which saves us from verbose configuration i.e auto scan(i.e <context:component-scan> .. </context:component-scan>), which detect and instantiate our beans from pre-defined project package, no more tedious beans declaration in in XML file.


So i am sure there must be some downside of auto scan approach. So any comments when we should go for auto scan and when not?


Aucun commentaire:

Enregistrer un commentaire