A Classic Example of Bridge: Drivers

A common use of BRIDGE occurs when an application uses a driver. A driver is an object that operates a computer system or an external device according to a well-specified interface. Applications that use drivers are abstractions: The effect of running the application depends on which driver is in place. Each driver is an instance of the ADAPTER pattern, providing the interface a client expects, using the services of a class with a different interface. An overall design that uses drivers is an instance of BRIDGE. The design separates application development from the development of the drivers that implement the abstract operations on which the applications rely.

An everyday example of applications using drivers ...

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.