EN: The client code works with complex subsystems through a simple interface provided by the Facade. When a facade manages the lifecycle of the subsystem, the client might not even know about the existence of the subsystem. This approach lets you keep the complexity under control.
(facade: Facade)
| 99 | |
| 100 | |
| 101 | def client_code(facade: Facade) -> None: |
| 102 | """ |
| 103 | EN: The client code works with complex subsystems through a simple interface |
| 104 | provided by the Facade. When a facade manages the lifecycle of the |
| 105 | subsystem, the client might not even know about the existence of the |
| 106 | subsystem. This approach lets you keep the complexity under control. |
| 107 | |
| 108 | RU: Клиентский код работает со сложными подсистемами через простой |
| 109 | интерфейс, предоставляемый Фасадом. Когда фасад управляет жизненным циклом |
| 110 | подсистемы, клиент может даже не знать о существовании подсистемы. Такой |
| 111 | подход позволяет держать сложность под контролем. |
| 112 | """ |
| 113 | |
| 114 | print(facade.operation(), end="") |
| 115 | |
| 116 | |
| 117 | if __name__ == "__main__": |