Summary

A common example of BRIDGE occurs in drivers. An application that uses a driver is an abstraction—the choice of driver determines what happens when the application runs. The interface between applications and drivers lets you vary either side independently. You can create new applications that use the drivers without changing the drivers. You can also add new drivers without changing existing applications. That is the intent of BRIDGE.

You may encounter abstractions that are not decoupled from their implementation but rather are arranged as an abstract class whose concrete subclasses provide various implementations. In such a case, you can apply BRIDGE if you want to factor the hierarchy along another line. Moving the implementations ...

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