门面模式
class Connect: def run(self): print('connect') class Request: def run(self): print('requset') class WebServer: def run(self): print('web server response') class Browser: def run(self): print('browser drawing') class Facade: def __init__(self): self.connect = Connect() self.request = Request() self.webServer = WebServer() self.browser = Browser() def runAll(self): self.connect.run() self.request.run() self.webServer.run() self.browser.run() if __name__ == '__main__': facade = Facade() facade.runAll()