标签:mic return ima his 例子 img 关系图 sys int
目的:为系统中的一组联动接口提供一个高层次的接口,从而降低系统的复杂性
优点:使用窗口模式可以使得接口变少
继承关系图:
例子:
class Subsystem1 { public: void Operation() { cout << "Subsystem1::Operation" << endl; } }; class Subsystem2 { public: void Operation() { cout << "Subsystem2::Operation" << endl; } }; class Facade { private: Subsystem1* _subsys1; Subsystem2* _subsys2; public: Facade() { this->_subsys1 = new Subsystem1(); this->_subsys2 = new Subsystem2(); } ~Facade() { delete this->_subsys1; delete this->_subsys2; } void OperationWrapper() { this->_subsys1->Operation(); this->_subsys2->Operation(); } };
int main() { Facade* pFacade = new Facade(); pFacade->OperationWrapper(); return 0; }
标签:mic return ima his 例子 img 关系图 sys int
原文地址:https://www.cnblogs.com/chusiyong/p/11433906.html