EN: The client code calls the template method to execute the algorithm. Client code does not have to know the concrete class of an object it works with, as long as it works with objects through the interface of their base class. RU: Клиентский код вызывает шаблонный метод для в
(abstract_class: AbstractClass)
| 127 | |
| 128 | |
| 129 | def client_code(abstract_class: AbstractClass) -> None: |
| 130 | """ |
| 131 | EN: The client code calls the template method to execute the algorithm. |
| 132 | Client code does not have to know the concrete class of an object it works |
| 133 | with, as long as it works with objects through the interface of their base |
| 134 | class. |
| 135 | |
| 136 | RU: Клиентский код вызывает шаблонный метод для выполнения алгоритма. |
| 137 | Клиентский код не должен знать конкретный класс объекта, с которым работает, |
| 138 | при условии, что он работает с объектами через интерфейс их базового класса. |
| 139 | """ |
| 140 | |
| 141 | # ... |
| 142 | abstract_class.template_method() |
| 143 | # ... |
| 144 | |
| 145 | |
| 146 | if __name__ == "__main__": |