Code Reuse Refactoring and moving to framework
-
05-10-2022 - |
Question
As a part code management for reusability, we are refactoring code.
Eg to move login components to a framework which other applications can also use.
Now thing is we are using a CommonFactory interface and its impl for dependency injection.
Eg LoginVw instance is defined as
@Override
public LoginVw getLoginVw() {
if(null == loginVw){
this.loginVw = new LoginVwImpl();
}
return this.loginVw;
}
Now as a part of code reuse..a BaseCommonFactory will go in framework which will take care of dependency injection for classes in framework eg LoginVw.
My question is how to implement BaseCommonFactory.
What i am thinking of is
- public interface BaseCommonFactory
- public interface CommonFactory extends BaseCommonFactory
- public abstract class BaseCommonFactoryImpl implements BaseCommonFactory
- public class CommonFactoryImpl extends BaseCommonFactoryImpl implements CommonFactory
Is this correct? Any suggestions will be greatly appreciated.
No correct solution
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow