| Okay. So you create a manager object (changeSupport) and you register objects that have members that want to be monitored with the manager. Then you add/create listeners (PropertyChangeListener) to listen for events around the registered object member.
As part of the listener creation, you specify an action that occurs when a property changes by specifying the propertyChange(PropertyChangeEvent pce) method. Presumably you could modify this to include a method call on the listening object that would update totals, for example, that included the changed object.
I could see this being useful. I also understand why it is normally tied to a GUI since it would make sense to refresh a display after updating values.
Thanks for sharing the code. |