-
Book Overview & Buying
-
Table Of Contents
Practical Design Patterns for Java Developers
By :
The goal of this pattern is to separate the abstraction from its implementation so that both can change independently. The bridge pattern was described by the GoF.
The bridge pattern is about prioritizing composition over inheritance. The implementation details are moved from the hierarchy to another object with a separate hierarchy. The bridge pattern uses encapsulation and aggregation, and may use inheritance to separate responsibilities into different classes.
Uses of the bridge pattern can be found in the java.util.logging package and the implementation of the Logger class. The class is located in the java.logging module. It implements the Filter interface. This interface is used to gain additional control over logged content beyond the standard log level.
Let us see an example of two types of vehicles: a sport car and a pickup. The vehicles vary...