Bridge API Documentation

class Implementor[source]

Bases: ABC

Defines the interface for the implementation in the Bridge Pattern.

abstractmethod implementation()[source]

Defines the operation implemented by concrete implementors.

Return type:

None

class ConcreteImplementorA[source]

Bases: Implementor

Provides a specific implementation of the Implementor interface.

implementation()[source]

Provides a concrete implementation of the operation.

Return type:

None

class ConcreteImplementorB[source]

Bases: Implementor

Provides another specific implementation of the Implementor interface.

implementation()[source]

Provides a concrete implementation of the operation.

Return type:

None

class Abstraction(implementor)[source]

Bases: object

Defines the abstraction in the Bridge Pattern. Works independently of the implementation.

Parameters:

implementor (Implementor)

__init__(implementor)[source]

Initializes the abstraction with a given implementor.

Parameters:

implementor (Implementor) – The concrete implementor to bridge with.

Return type:

None

operation()[source]

Performs an operation using the implementor.

Return type:

None

class RefinedAbstraction(implementor)[source]

Bases: Abstraction

Extends the base abstraction to add more behavior.

Parameters:

implementor (Implementor)

operation()[source]

Adds additional behavior before or after delegating to the implementor.

Return type:

None