Chapter 9. Bridge
Let's say there is a manufacturer that produces TV sets. Each TV set has a remote control that allows the user to change channels and whatnot. A remote control is an interface to control a TV. If every TV model needs a unique remote control, then there will be an explosion of designs just for remote controls. Every remote control has some features that are common among different models of TVs, though, such as channel changing, volume, and power on/off. And each TV should be able to respond to these commands sent from a remote control with primitive command interfaces. We can separate remote control logic from actual TV models. So changes in TV models should not have any impact on the design of the remote controls. The same design ...
Get Pro Objective-C Design Patterns for iOS 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.