客户端代码
public class Client {
public static void main(String[] args) {
CookeProxy proxy,proxy1,proxy2;
proxy = new CookeProxy(new BigCooker());
proxy1 = new CookeProxy(new CommonCooker());
proxy2 = new CookeProxy(new aunt());
proxy.cooke();
System.out.println("********");
proxy1.cooke();
System.out.println("********");
proxy2.cooke();
}
}
大厨师
public class BigCooker implements ICooker{
@Override
public void cooke() {
System.out.println("我会做红烧肉");
}
}
大娘厨师
public