Introducing the Bridge Pattern
According to the Gang of Four, the intent of the Bridge pattern is to “De-couple an abstraction from its implementation so that the two can vary independently.”[1]
[1] Gamma, E., Helm, R., Johnson, R., Vlissides, J., Design Patterns: Elements of Reusable Object-Oriented Software, Reading, Mass.: Addison-Wesley, 1995, p. 151.
I remember exactly what my first thoughts were when I read this:
Huh?
And then,
How come I understand every word in this sentence but I have no idea what it means?!
I knew that
De-couple means to have things behave independently from each other or at least explicitly state what the relationship is, and
Abstraction is how different things are related to each other conceptually.
And I thought ...
Get Design Patterns Explained: A New Perspective on Object-Oriented 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.