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

Function client_code

src/Decorator/Conceptual/main.py:109–124  ·  view source on GitHub ↗

EN: The client code works with all objects using the Component interface. This way it can stay independent of the concrete classes of components it works with. RU: Клиентский код работает со всеми объектами, используя интерфейс Компонента. Таким образом, он остаётся независимым

(component: Component)

Source from the content-addressed store, hash-verified

107
108
109def client_code(component: Component) -> None:
110 """
111 EN: The client code works with all objects using the Component interface.
112 This way it can stay independent of the concrete classes of components it
113 works with.
114
115 RU: Клиентский код работает со всеми объектами, используя интерфейс
116 Компонента. Таким образом, он остаётся независимым от конкретных классов
117 компонентов, с которыми работает.
118 """
119
120 # ...
121
122 print(f"RESULT: {component.operation()}", end="")
123
124 # ...
125
126
127if __name__ == "__main__":

Callers 1

main.pyFile · 0.70

Calls 1

operationMethod · 0.45

Tested by

no test coverage detected