Bridge Pattern

noun

say it: “BRIJ PAT-urn” /brɪdʒ ˈpætərn/

A design pattern that splits two things that change on their own into two families of classes, joined by a has-a link.

What is the Bridge pattern?

The Bridge pattern splits two things that vary on their own into two class families and joins them with a has-a link, the bridge. Three controls (a phone app, voice, a wall panel) and three brands of device would need nine pair classes; as a bridge, each control holds a device, so there are six classes, and a new control or brand is one more.

In a sentence

  • “With the Bridge pattern, the smartwatch app was one new control class instead of three.”

Level: Freelancer · More OOP terms at this level

Updated