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

Class Implementation

src/Bridge/Conceptual/main.py:63–80  ·  view source on GitHub ↗

EN: The Implementation defines the interface for all implementation classes. It doesn't have to match the Abstraction's interface. In fact, the two interfaces can be entirely different. Typically the Implementation interface provides only primitive operations, while the Abstraction

Source from the content-addressed store, hash-verified

61
62
63class Implementation(ABC):
64 """
65 EN: The Implementation defines the interface for all implementation classes.
66 It doesn't have to match the Abstraction's interface. In fact, the two
67 interfaces can be entirely different. Typically the Implementation interface
68 provides only primitive operations, while the Abstraction defines higher-
69 level operations based on those primitives.
70
71 RU: Реализация устанавливает интерфейс для всех классов реализации. Он не
72 должен соответствовать интерфейсу Абстракции. На практике оба интерфейса
73 могут быть совершенно разными. Как правило, интерфейс Реализации
74 предоставляет только примитивные операции, в то время как Абстракция
75 определяет операции более высокого уровня, основанные на этих примитивах.
76 """
77
78 @abstractmethod
79 def operation_implementation(self) -> str:
80 pass
81
82
83"""

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected