Originally posted by Oliver Watkins:
b) The Requirements are a bit bizarre. What puzzles me the most, is that the requirements state nothing about a user updating a record that has changed since the GUI read the record. This is really poor software design.
Client A can read record where customer is "", then Client B can update it so that its customer is "abc", and then Client A can update it so that its customer is "xyz".
This is pretty poor. Shouldn't Client A get a message or something saying "record has been updated. Do you wish to overwrite?". I really wish the assignment said something like this. Rather than the silly SecurityExcepton check, why not a RecordModifiedException ?
Originally posted by Oliver Watkins:
...
b) The Requirements are a bit bizarre. What puzzles me the most, is that the requirements state nothing about a user updating a record that has changed since the GUI read the record. This is really poor software design.
Client A can read record where customer is "", then Client B can update it so that its customer is "abc", and then Client A can update it so that its customer is "xyz".
This is pretty poor. Shouldn't Client A get a message or something saying "record has been updated. Do you wish to overwrite?". I really wish the assignment said something like this. Rather than the silly SecurityExcepton check, why not a RecordModifiedException ?
...
SCJP, SCWCD, SCJD
Originally posted by Oliver Watkins:
Heya... my first ever post. Been doing SCJD for 3 months now.
Originally posted by Oliver Watkins:
So anyway.. i thought I might as well synchronize on the RAF object during the update method.
Originally posted by Oliver Watkins:
a) Things seem a tad over synchronized. My lock and unlock methods are synchronized, and then when I call the update() method, the whole internals of the method are contained in a synchronize block, because I am synchronizing the RAF.
Originally posted by Oliver Watkins:
Performance wise I just think it's a bit rubbish. There is nothing between these three pieces of code. It's just synch, synch and synch. I just don't like it. I might as well chuck the whole thing into one synch block.
Originally posted by Oliver Watkins:
b) The Requirements are a bit bizarre. What puzzles me the most, is that the requirements state nothing about a user updating a record that has changed since the GUI read the record. This is really poor software design.
Originally posted by Oliver Watkins:
Client A can read record where customer is "", then Client B can update it so that its customer is "abc", and then Client A can update it so that its customer is "xyz".
The Sun Certified Java Developer Exam with J2SE 5: paper version from Amazon, PDF from Apress, Online reference: Books 24x7 Personal blog
Did you see how Paul cut 87% off of his electric heat bill with 82 watts of micro heaters? |