This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
I created a program that allows teachers to create topics from different assignments and compare grades and get an overall comprehension level. The program uses tabs to help the user go step by step to the final overview tab. I have an Import, Allocate Assignments, and Overview tab that all share a Gradebook object.
The problem is the Gradebook object is not updating in every tab. My work-around was to update every tab by passing in a new Gradebook object every time the user changes tab. I do not like this setup because the program updates even if nothing was changed in the Gradebook object, which is inefficient. Is there a better way?
Thank you for your input. I did not realize there was even such a thing available. I Google searched property change listener and found a tutorial directly from Sun, here How to Write a Property Change Listener.
Seems I have much to learn since the tutorial began talking about JavaBeans. I do not have any experience with Beans, does anyone know a great resource to get me in the right direction?
Thank you! It will take me time to understand all of this. E.G., I had to look up POJO, which I now know is an acronym for "Plain Old Java Object".
I am confused by your final POJO string. Can the string contain anything? I guess I'm wondering what the purpose of the string is in general.
When you fire a property change event, you need to send a string to identify what property is been changed.
Lets say all your tabs are listeners of a different property change, what will happen is: Any time any property changes, all your tabs are going to be warned, it's up to the tabs to know if the changed property is the one that matters to then.
When I did it the first time I had a nice tutorial about it but apparently I don't have it anymore .