EN: Except for the initialization phase, where an Abstraction object gets linked with a specific Implementation object, the client code should only depend on the Abstraction class. This way the client code can support any abstraction-implementation combination. RU: За исключени
(abstraction: Abstraction)
| 100 | |
| 101 | |
| 102 | def client_code(abstraction: Abstraction) -> None: |
| 103 | """ |
| 104 | EN: Except for the initialization phase, where an Abstraction object gets |
| 105 | linked with a specific Implementation object, the client code should only |
| 106 | depend on the Abstraction class. This way the client code can support any |
| 107 | abstraction-implementation combination. |
| 108 | |
| 109 | RU: За исключением этапа инициализации, когда объект Абстракции связывается |
| 110 | с определённым объектом Реализации, клиентский код должен зависеть только от |
| 111 | класса Абстракции. Таким образом, клиентский код может поддерживать любую |
| 112 | комбинацию абстракции и реализации. |
| 113 | """ |
| 114 | |
| 115 | # ... |
| 116 | |
| 117 | print(abstraction.operation(), end="") |
| 118 | |
| 119 | # ... |
| 120 | |
| 121 | |
| 122 | if __name__ == "__main__": |