Skip to content
StackDecode
System Design
15. Software Design PatternsAnimated walkthrough

Bridge Pattern

Separate an abstraction from its implementation.

The idea

Two hierarchies vary independently, such as shapes and rendering engines.

Watch it work

The steps light up one at a time. Use the controls to pause or step through.

  1. 1Define the abstraction
  2. 2Define the implementation interface
  3. 3Abstraction holds an implementation
  4. 4Mix freely
1/4

Step by step

  1. 1Define the abstraction
  2. 2Define the implementation interface
  3. 3Abstraction holds an implementation
  4. 4Mix freely

Where it is used

Avoiding class explosion.

Watch out for

Added complexity for simple cases.

Related