Design Pattern in php-Facade pattern. Design Pattern in php-Facade pattern;} (2) pc machine classPcmachine {publicfunctionturnOn () {} publicfunctionturnOff () {echoturnoffPcMathion;} (3) power-off the design mode in TLS php-facade mode
';}} // (2) pc machine class Pcmachine {public function turnOn () {} public function turnOff () {echo' turn off PcMathion
';}}// (3) Power off class Power {public function turnOn () {} public function turnOff () {echo' turn off Power
';}} // Class PcFacade implements Facade {private $ PcLight; private $ Pcmachine; private $ Power; public function _ construct () {$ this-> 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 () {}} // application $ button = new PcFacade (); $ button-> turnOff (); /* In fact, the facade mode refers to several subsystems (instances or classes. A unified interface is used for execution, and the client only needs to use the facade without paying attention to the subsystem)
Examples;} // (2) pc machine class Pcmachine {public function turnOn () {} public function turnOff () {echo turn off PcMathion ;}// (3) turn off the power of the CIA...