Appendix A. Leftover Patterns
Not everyone can be the most popular. A lot has changed in the last 25+ years. Since Design Patterns: Elements of Reusable Object-Oriented Software first came out, developers have applied these patterns thousands of times. The patterns we summarize in this appendix are full-fledged, card-carrying, official GoF patterns, but aren’t used as often as the patterns we’ve explored so far. But these patterns are awesome in their own right, and if your situation calls for them, you should apply them with your head held high. Our goal in this appendix is to give you a high-level idea of what these patterns are all about.
Bridge
Use the Bridge Pattern to vary not only your implementations, but also your abstractions.
A scenario
Imagine you’re writing the code for a new ergonomic and user-friendly remote control for TVs. You already know that you’ve got to use good object-oriented techniques because while the remote is based on the same abstraction, there will be lots of implementations—one for each model of TV.
Your dilemma
You know that the remote’s user interface won’t be right the first time. In fact, you expect that the product will be refined many times as usability data is collected on the remote control.
So your dilemma is that the remotes are ...
Get Head First Design Patterns, 2nd Edition 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.