MCPcopy Create free account
hub / github.com/RefactoringGuru/design-patterns-python / client_code

Function client_code

src/TemplateMethod/Conceptual/main.py:129–143  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

127
128
129def 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
146if __name__ == "__main__":

Callers 1

main.pyFile · 0.70

Calls 1

template_methodMethod · 0.80

Tested by

no test coverage detected