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

Function client_code

src/Bridge/Conceptual/main.py:102–119  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

100
101
102def 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
122if __name__ == "__main__":

Callers 1

main.pyFile · 0.70

Calls 1

operationMethod · 0.45

Tested by

no test coverage detected