MΓ³dulo 23 Β· Design Patterns (All 23 GoF) β LecciΓ³n 7 de 23 Β· ~6 min
Bridge
Bridge: split abstraction from implementation
Problem: two dimensions vary independently. If you subclass for every combination you get a class explosion.
PawWalk scenario: a Notification (the what β reminder, receipt) holds a Transport (the how β SMS, email). Add a new transport OR a new notification type without touching the other axis.
The bridge is just composition: the abstraction holds a reference to the implementation and delegates the varying part to it.