package com.hcmony.factory.abstractFactory;
import com.hcmony.factory.factory.MyInterface;
/**
* <h3>Shenjue.java基本描述</h3>
* <p></p>
*
* @author hcmony
* @since V1.0.0, 2018/04/03 21:27
*/
public interface Provider {
public MyInterface produce();
}
package com.hcmony.factory.abstractFactory;
import com.hcmony.factory.factory.MyClassOne;
import com.hcmony.factory.factory.MyInterface;
/**
* <h3>Shenjue.java基本描述</h3>
* <p></p>
*
* @author hcmony
* @since V1.0.0, 2018/04/03 21:27
*/
public class MyFactoryOne implements Provider {
@Override
public MyInterface produce() {
return new MyClassOne();
}
}
package com.hcmony.factory.abstractFactory;
import com.hcmony.factory.factory.MyClassTwo;
import com.hcmony.factory.factory.MyInterface;
/**
* <h3>工厂方法模式有一个问题就是&#x