Revision Notes/Design Patterns

Field Entry  -  Design Patterns

 Coreintermediate

Bridge Pattern

Decouples an abstraction from its implementation so that the two can vary independently — preventing a class explosion when you have multiple dimensions of variation.

#structural#bridge#decoupling#composition#gof

Field Note - Real-world Analogy

Think of it like this

Think of a TV remote control (abstraction) and the TV (implementation). You can use the same remote design with different TV brands. And different remote designs can control the same TV. The remote and TV vary independently because they're connected through a standardized IR signal interface — the bridge.

Field Observations - Key Topics Covered

01

The problem Bridge solves: suppose you have a Shape class with Circle and Square subclasses, and you also need Dark and Light color variants. With inheritance alone, you need DarkCircle, LightCircle, DarkSquare, LightSquare — 4 classes for 2 shapes × 2 colors. Add a new shape or color and the count explodes multiplicatively.

4 more observations inside

Sign in to read every key point in full

Unlock Full Note

Ready to go deeper?

Open the complete revision note.

Sign in to read every field observation in full, including a runnable code example and side-by-side comparisons with related patterns.

Read Full Notes