外观模式, 为子系统中的一组接口提供一个一致的界面, 此模式定义了一个高层接口, 这个接口使得这一子系统更加容易使用.
class SusSystemOne {
public void MethodOne() {
// todo
}
}
class SubSystemTwo {
public void MethodTwo() {
// todo
}
}
class SubSystemThree {
public void MethodThree() {
// todo
}
}
class SubSystemFour {
public void MethodFour() {
// todo
}
}
class Facade {
SubSystemOne one;
SubSystemTwo two;
SubSystemThree three;
SubSystemFour four;
public Facade() {
one = new SubSystemOne();
two = new SubSystemTwo();
three = new SubSystemThree();
four = new SubSystemFour();
}
public void MethodA() {
one.MethodOne();
two.MethodTwo();
four.MethodFour();
}
public void MethodB() {
two.MethodTwo();
three.MethodThree();
}
}
public static void Main(string[] agrs) {
Facade facade = new Facade();
facade.MathodA();
facade.MathodB();
}