© The Author(s), under exclusive license to APress Media, LLC, part of Springer Nature 2022
D. NesterukDesign Patterns in .NET 6https://doi.org/10.1007/978-1-4842-8245-8_8

8. Bridge

Dmitri Nesteruk1  
(1)
St. Petersburg, c.St-Petersburg, Russia
 

One very common situation that occurs when designing software is the so-called state space explosion where the number of related entities required to represent all possible states “explodes” in a Cartesian product fashion. For example, if you have circles and squares of different colors, you might end up with classes such as RedSquare, BlueSquare, RedCircle, BlueCircle, etc. Clearly, nobody wants that.

What we do instead is we connect things together, and there are different ways of doing that. For example, ...

Get Design Patterns in .NET 6: Reusable Approaches in C# and F# for Object-Oriented Software Design now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.