It looks so much easier to understand with a class diagram!!!
Question: Are there other types of locking mechanism that can be used or preferred? I find this one very simple to use and easy to code.
Is there anything I should know about the FBN assignment that could come back and haunt me?
The Sun Certified Java Developer Exam with J2SE 5: paper version from Amazon, PDF from Apress, Online reference: Books 24x7 Personal blog
Andrew, one thing I forgot to ask was how you managed to put Class diagrams into your return text document?
The Sun Certified Java Developer Exam with J2SE 5: paper version from Amazon, PDF from Apress, Online reference: Books 24x7 Personal blog
Is there anything I should know about the FBN assignment that could come back and haunt me?
Any comments would be helpful.
[/QB]
Amend the Vector to a static HashMap (key = Integer object reference of the record number and value = Data object reference (i.e. "this").
The Sun Certified Java Developer Exam with J2SE 5: paper version from Amazon, PDF from Apress, Online reference: Books 24x7 Personal blog
One idea is to change the "int recordCount" to a "static Integer recordCount" and put a synchronization block on recordCount prior to adding a new record. This would protect the recordCount from being updated until after the new record has been written.
I was wrong in thinking that you could lock a new record because (a) why would you - it doesn't exist yet so no one can access it and (b) you don't know the record number until it is created.
Does this sound reasonable? Are we allowed to change the member variables on the Data class - has anyone done this before or know if it would prompt an instant fail?
The Sun Certified Java Developer Exam with J2SE 5: paper version from Amazon, PDF from Apress, Online reference: Books 24x7 Personal blog
Oh sure, it's a tiny ad, but under the right circumstances, it gets bigger.
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
|