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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.