外观模式
//外观模式
public class Facade {
private SubSystem1 subSystem1 = new SubSystem1();
private SubSystem2 subSystem2 = new SubSystem2();
private SubSystem3 subSystem3 = new SubSystem3();
public void method(){
subSystem1.methhod1();
subSystem2.methhod2();
subSystem3.methhod3();
}
}
//子系统一
public class SubSystem1 {
public void methhod1(){
System.out.println("调用子系统一");
}
}
//子系统二
public class SubSystem2 {
public void methhod2(){
System.out.println("调用子系统二");
}
}
//子系统三
public class SubSystem3 {
public void methhod3(){
System.out.println("调用子系统三");
}
}
//测试一下!
public class test {
public static void main(String[] args) {
Facade facade = new Facade();
facade.method();
}
}
来源:CSDN
作者:咕咕咕~
链接:https://blog.csdn.net/weixin_42340366/article/details/103979128