The Bridge pattern is a structural GoF design pattern by Erich Gamma, Richard Helm, Ralph Johnson and John Vlissides that decouples an abstraction from its implementation so that the two can vary independently. Abstraction and implementation sit in separate class hierarchies, each extensible by subclassing, which avoids a permanent binding between them and keeps changes in the implementation from affecting clients.

GoF-Bridge Pattern

Details
Full Name

GoF Bridge Pattern (Structural)

Intent:

Decouple an abstraction from its implementation so that the two can vary independently.

When to Use:

  • When you want to avoid a permanent binding between an abstraction and its implementation

  • When both the abstractions and their implementations should be extensible by subclassing

  • When changes in the implementation should have no impact on clients

Prompt Example:

"Trenne die Rendering-Abstraktion von der plattformspezifischen Implementierung nach dem GoF-Bridge Pattern, damit beide unabhängig erweitert werden können."