Design Patterns · Middle · Question 16 of 75

Notifications come in three types and are sent over three channels (email, push, SMS). Which pattern saves you from 9 classes?

Explanation

Bridge separates the abstraction (notification type) from the implementation (channel) and links them via composition: 3 + 3 classes instead of 3 × 3. A new channel is added without changing the types.

Further reading

Problem with a question

Design Patterns · Middle · question 16

Test yourself

Take the Design Patterns · Middle quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz