public class SubSystemOne {
public void MethodOne(){
System.out.println(" 子系统方法一");
}
}
public class SubSystemTwo {
public void MethodTwo(){
System.out.println(" 子系统方法二");
}
}
public class SubSystemThree {
public void MethodThree(){
System.out.println(" 子系统方法三");
}
}
public class SubSystemFour {
public void MethodFour(){
System.out.println(" 子系统方法四");
}
}
public class Facade {
private SubSystemOne one;
private SubSystemTwo two;
private SubSystemThree three;
private SubSystemFour four;
public Facade() {
one = new SubSystemOne();
two = new SubSystemTwo();
three = new SubSystemThree();
four = new SubSystemFour();
}
public void MethodA() {
System.out.println("\n方法组A()-----");
one.MethodOne();
two.MethodTwo();
four.MethodFour();
}
public void MethodB() {
System.out.println("\n方法组B()-----");
two.MethodTwo();
three.MethodThree();
}
}
public class TestUtil {
public static void main(String[] args) throws CloneNotSupportedException {
Facade facade = new Facade();
facade.MethodA();
facade.MethodB();
}
}