You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
package factory;
|
|
|
|
public abstract class Creator {
|
|
|
|
public abstract Product factoryMethod();
|
|
|
|
|
|
public void someOperation() {
|
|
// 调用工厂方法创建产品
|
|
Product product = factoryMethod();
|
|
// 使用产品
|
|
product.operation();
|
|
}
|
|
} |