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

  1. public interface BaseCommonFactory
  2. public interface CommonFactory extends BaseCommonFactory
  3. public abstract class BaseCommonFactoryImpl implements BaseCommonFactory
  4. public class CommonFactoryImpl extends BaseCommonFactoryImpl implements CommonFactory

Is this correct? Any suggestions will be greatly appreciated.

Pas de solution correcte

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top