Beispiel #1
0
        echo "subsystem3 method3<br>";
    }
}
class Facade
{
    private $_object1 = null;
    private $_object2 = null;
    private $_object3 = null;
    public function __construct()
    {
        $this->_object1 = new SubSystem1();
        $this->_object2 = new SubSystem2();
        $this->_object3 = new SubSystem3();
    }
    public function MethodA()
    {
        echo "Facade MethodA<br>";
        $this->_object1->Method1();
        $this->_object2->Method2();
    }
    public function MethodB()
    {
        echo "Facade MethodB";
        $this->_object2->Method2();
        $this->_object3->Method3();
    }
}
$objFacade = new Facade();
$objFacade->MethodA();
$objFacade->MethodB();