Bridge Design Pattern �(Structural)
Thanh Le – Software Architect / Technical Consultant
Complexity: 3/3
Popularity: 1/3
Intent
��
Image source: internet
Motivation
You have a geometric Shape class with a pair of subclasses: Circle and Square.
You want to extend this class hierarchy to incorporate colors, so you plan to create Red and Blue shape subclasses. However, since you already have two subclasses, you’ll need to create four class combinations such as BlueCircle and RedSquare.
���
Image source: internet
Number of class combinations grows in geometric progression.
Solution
Image source: internet
You can prevent the explosion of a class hierarchy by transforming it into several related hierarchies.
Abstraction and Implementation
Image source: internet
Structure
Image source: internet
Pros/Cons
Practice
https://github.com/thanhle0212/23GoF-Design-Patterns-CSharp