其他分享
首页 > 其他分享> > 设计模式-门面模式

设计模式-门面模式

作者:互联网

 

public class System1 {
public void dosomething() {
System.out.println("system1..");
}
}

public class System2 {
public void dosomething() {
System.out.println("system2..");
}
}

public class Facade {
System1 system1 = new System1();
System2 system2 = new System2();
public void dosomething() {
system1.dosomething();
system2.dosomething();
}
}

public class Client1 {
public static void main(String[] args) {
Client1 client1 = new Client1();
client1.dosomething();
}

public void dosomething() {
Facade facade = new Facade();
facade.dosomething();
}
}

public class Client2 {
public static void main(String[] args) {
Client2 client2 = new Client2();
client2.dosomething();
}

public void dosomething() {
Facade facade = new Facade();
facade.dosomething();
}
}

标签:dosomething,void,模式,class,Facade,门面,new,设计模式,public
来源: https://www.cnblogs.com/ladeng19/p/15933990.html