Skip to main content

Bridge Pattern

Learn Bridge Pattern (Structural Patterns, Design Patterns in Java) with worked examples, diagrams and interview questions. Free on JavaSchoolLab.

The Bridge Pattern decouples an abstraction from its implementation so the two can vary independently - instead of one growing inheritance tree, you split it into two smaller, separately-extensible hierarchies connected by composition. Real-Life Example: A TV remote (abstraction) working with different TV brands (implementation) - the remote's buttons stay the same regardless of which brand it controls A universal charger (abstraction) working with different phone brands' charging circuits A payment app (abstraction) working with different payment gateway implementations Why do we need Bridge?...

More lessons in Structural Patterns