O'Reilly logo

Pro Objective-C Design Patterns for iOS by Carlo Chung

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required