Campbell Ritchie wrote:There is something wrong with a Book class which maintains a list of books. That belongs in a different class, I would think. Also there is something wrong when you start writing static.
Campbell Ritchie wrote:I am always suspicious of things static. Your read and save methods do not apply to a book; they apply to a library. So maybe you should write a Library class to encapsulate that set of books.
Make the read and save methods non-static, unless you are sure you cannot have several libraries each with a different set of books.
Why are you using a linked set rather than a list?
Michael Dunn wrote:> Lastly I want the app to be able to then save out all the objects again into the file when a user hits the close button.
much better to save whenever a change is made - computer crash, electricity blackout, etc etc
look up TableModelListener
Don't get me started about those stupid light bulbs. |