您好,欢迎访问一九零五行业门户网

php中的设计模式之门面模式

pclight = new pclight(); $this->pcmachine = new pcmachine(); $this->power = new power(); } // 门面角色的应用 public function turnoff() { $this->pclight ->turnoff(); $this->pcmachine ->turnoff(); $this->power ->turnoff(); } public function turnon() {} }// 应用$button = new pcfacade(); $button ->turnoff(); /* 其实门面模式就是把几个子系统(实例或者类.统一一个统一的接口进行执行,客户端不用关注子系统,只用门面即可 )
其它类似信息

推荐信息