This week's book giveaway is in the General Computing forum. We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line! See this thread for details.
Here is my effort to implement a GUI that gets information from two panels and displays the information back to one of those panels and another output only panel. It's a lot simpler than what I need to implement eventually, but do I have the idea right? It seemed a little squirrelly to me to be both adding an object as an observer so that its view could be updated and passing the observer in as an argument so that I could access the data.
I'm also a little unsure about my setValue methods in the Observable. Different objects will set different subsets of the data. I 'cheated' in the example since the parameter types were different. Should I define some additional classes for the subsets of my data, which would allow me to more cleanly overload the setValue method? And then define yet another class that contains all this subsets that the notifyObservers() method returns or is it better not to pass an object with the updated data and have a bunch of methods that let each observer pull out what matters to them? And is there a simple way to indicate some subset of the data did not change, so some objects don't need to update?