6 Bridge
THE BRIDGE, OR Driver, pattern focuses on the design of an abstraction. The word abstraction refers to a class that relies on a set of abstract operations, where several implementations of the set of abstract operations are possible.
The ordinary way to implement an abstraction is to create a class hierarchy, with an abstract class that defines the abstract operations at the top; each subclass in the hierarchy provides a different implementation of the set of abstract operations. This approach becomes insufficient when you need to subclass the hierarchy for some other reason.
You can create a BRIDGE by moving the set of abstract operations to an interface, so that an abstraction will depend on an implementation of the interface.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access