Chapter 12. Observer

Like an example in the Mediator pattern chapter (Chapter 11), air traffic needs a centralized air traffic control. There are many operators sitting inside the air controller tower watching their radar screens to make sure no mid-air collision can occur. At the same time, pilots who are flying their multimillion-dollar big birds need to know what's happening around them, i.e., the traffic in the air. Pilots can tune to specific channels on their radio and listen to (observe) the surrounding traffic. If a traffic controller broadcasts certain precautions and warnings to those pilots who are observing the channel, the pilots can acknowledge the messages with certain actions. So in this model, anyone can know what traffic control ...

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.