A Bridge Using the List Interface

Drivers offer good examples of the BRIDGE pattern, but you can apply BRIDGE in other situations, too. Whenever you separate an abstraction—a class that relies on a set of abstract operations—from the implementation of its abstract operations, you have applied BRIDGE.

Consider the Queue class in use at Oozinoz. When using a list to model a conveyor, you have discovered that it is easy to get confused about which end of the list applies to which end of a conveyor. To avoid this confusion, Oozinoz developers always define the ends of the conveyor as the conveyor's tail and head and define that the belt moves from the tail toward the head. Placing material on the tail of a conveyor enqueues the material on the conveyor; ...

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.