public class Facade {
/**
* @param args 外观模式
*/
One one;
Two two;
Three three;
public Facade() {
one=new One();
two=new Two();
three=new Three();
}
public void Method1() {
System.out.println("********1");
one.methodone();
two.methodtwo();
}
public void Methon2() {
System.out.println("*********2");
two.methodtwo();
three.methodthree();
}
public static void main(String[] args) {
// TODO Auto-generated method stub
Facade facade=new Facade();
facade.Method1();
facade.Methon2();
}
}
class One{
public void methodone() {
System.out.println("1111");
}
}
class Two{
public void methodtwo() {
System.out.println("2222");
}
}
class Three{
public void methodthree() {
System.out.println("3333");
}
}