Will two instances of MasterDao class be created? One for showAllProductsController and one for addToCartController ?
A single instance of MasterDAO will be created & injected in the controllers. The default scope for beans created by Spring is singleton.
Shouldn't all the methods defined in MasterDao class be static so that nobody can new an instance and call these methods ?
For beans created/manged by Spring the new construct is not supposed to be used. Spring creates the beans & manages the lifecycle of the beans, i:e manages dependency.