DESIGN PATTERNS SERIES

How to Avoid Exponential Growth of Classes by Applying Bridge Pattern in C#

I wrongly designed my code which could lead to the multiplication classes. Then I was introduced to Bridge Pattern and fix my code design.

Daniel Rusnok
.NET Core
Published in
7 min readOct 5, 2020

--

The Gang of Four Definition

The Bridge Pattern was introduced to the public in the book Design Patterns: Elements of Reusable Object-Oriented Software by Gamma Erich, Helm Richard, Johnson Ralph, Vlissides John, also known as the Gang of Four.

The definition — “Its purpose is to decouple an abstraction from its implementation so that two can vary independently.”

It can be difficult to understand because the explanation is quite confusing by itself. It is not completely obvious what abstraction and implementation stand for. Some can say that it is about interfaces and concrete implementations, but it is not. Let me show you why.

To fully understand the power of the Bridge Pattern, I recommend you follow my tutorial. It was made with an emphasis on real enterprise application aspects. After finishing this tutorial, you will be ready to recognize in time, if your code design is leading to an exponential growth of…

--

--

Daniel Rusnok
.NET Core

Senior Software Developer. Loving to gain & share knowledge. Focused on Microsoft technologies like Azure, .NET Core & C#. Software Architecture enthusiasist.