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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access