CHAPTER 22

image

Bridge Patterns (Or Handle/Body Patterns)

GoF Definition: Decouple an abstraction from its implementation so that the two can vary independently.

Concept

In this pattern, the abstract class is separated from the implementation class and we provide a bridge interface between them. This interface helps us to make concrete class functionalities independent from the interface implementer class. We can alter these different kind of classes structurally without affecting each other.

Real-Life Example

In a software product development company, the development team and technical support team both play a crucial role. A change in the operational ...

Get Java Design Patterns 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.