I am trying to currently get a good grasp on the Observer design pattern, but I am stuck wondering about one specific issue. In the examples I have been able to find of implementation, they are all rather basic in terms of having a specifically designed state.
For instance, the "subject" class that is being observed only has a single state or variable that is being reported to any other classes observing it. My question is, what happens when you have a class representing a large or complex data structure?
Lets say I have multiple variables on a single class, and implement it as observable. Then setup something to watch it for changes in a specific variable. Does the observing class need to be notified every time something changes not related to what it is interested in? If so, do I have to write an update method for each type of variable that could potentially be observed? Or should I be writing an observer for every single variable on the class that could be observed?
Any clarity on this matter is appreciated.