design-patterns/structural/facade/subsystems.py
2020-09-27 14:26:34 +02:00

24 lines
613 B
Python

class Subsystem1:
"""
The Subsystem can accept requests either from the facade or client directly.
In any case, to the Subsystem, the Facade is yet another client, and it's
not a part of the Subsystem.
"""
def operation1(self) -> str:
return "Subsystem1: Ready!"
def operation_n(self) -> str:
return "Subsystem1: Go!"
class Subsystem2:
"""
Some facades can work with multiple subsystems at the same time.
"""
def operation1(self) -> str:
return "Subsystem2: Get ready!"
def operation_z(self) -> str:
return "Subsystem2: Fire!"