O'Reilly logo

Java™ Design Patterns: A Tutorial by James W. Cooper

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 22. The Observer Pattern

In this chapter we discuss how you can use the Observer pattern to present data in several forms at once.

In the more sophisticated windowing world, we often want to display data in more than one form at the same time and have all of the displays reflect any changes in the data. For example, we might represent stock price changes as both a graph and a table or list box. Each time the price changes, we'd expect both representations to change at once without any action on our part.

We expect this sort of behavior because many Windows applications, such as Excel, demonstrate such behavior. However, nothing inherent in Windows allows this activity, and, as you might know, programming directly in Windows in C or C++ is ...

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