I am developing a series of webservices (based on spring and spring mvc).
For the first time in my dev career I do plan on replacing the dao layer in the future(I have always seen it mentioned but never had to do it).
Currently I'm using spring annotations, so I could simply change the qualifier name of the injected dao in each place it is used; is there a better (global) mechanism I could use ?
Currently my code looks like this (declaring the dao) :
@Repository("regionDao")
public class RegionDao implements IRegionDao
and Injecting it :
@Resource(name = "regionDao")
IRegionDao regionDao;
But going into each service class and changing the qualifier name seems rather long winded, is their a better way. Basically in the future I want to flip a switch and each reference to a regionDao will then point to newRegionDao and so on for other dao's.
A solution using annotations is preferred- for no other reason than I subjectively prefer them. But I realize this may be a case for xml based config ?