Chapter 21
- The bridge pattern is useful when there is a need to share an implementation among different objects without having to implement individual specialized classes. This is typically done with either an abstract class that generalizes the different use cases or the individual specialized classes themselves.
- The adapter is generally used to make two incompatible interfaces compatible, while the bridge abstracts out the generalization of different classes.
- We define an abstract content fetcher class, from which two specialized classes inherit: a local file fetcher and a URL fetcher.