I am working on a legacy application and am converting it to spring. It currently uses a static flag to do some code differently depending on the country which it has been deployed in. For example:
public void myMethod() {
//a load of code here
if(Flags.US_BUILD == true) {
//US Build exclusive code here
}
//do some more code
}
Intuitively my approach would be to decouple the U.S code into an interface for which the appropriate implementation get's wired in depending on whether the build is U.S or not. I am wondering if this can be configured in my spring beans definition file (ie checking against a flag to control how things are wired), or if I am aiming at the right approach at all?