首页 > 代码库 > 代理模式

代理模式

代理模式【Proxy Pattern 】

interface KindWomen{
void makeEyes();
}

class Pan implements KindWomen{
@Override
public void makeEyes() {

}
}

class Wang implements KindWomen{
private Pan pan;
public Wang() {
this.pan = new Pan();
}

@Override
public void makeEyes() {
this.pan.makeEyes();
}
}

public class Xi{
public static void main(String[] args) {
Wang w = new Wang();
w.makeEyes();
}
}

 

代理模式