Thanks,<br />Mike
Thanks,<br />Mike
"I'm not back." - Bill Harding, Twister
Thanks,<br />Mike
"I'm not back." - Bill Harding, Twister
[Mike]: Perhaps, I can assume that only one program can access database file at any given time.
[Jim]: My guess is that's what was intended, unless you can find other quotes that contradict this. I suspect that they added explicit instructions about this to later assignments, because some people might have made their solutions more complex than intended, trying to guard against other programs accessing the DB.
The Sun Certified Java Developer Exam with J2SE 5: paper version from Amazon, PDF from Apress, Online reference: Books 24x7 Personal blog
Discipline, Dedication and Determination define Destiny.
[Andrew]: You will have noticed that most of the methods of Data class call invariant() to verify that nothing untoward has happened to the database between accesses. I think that this is all Sun require in the way of verifying that only one application is modifying the database at any given time.
[Andrew]: Personally I think it would be very difficult to guarantee that only one application could access the database at any given time. There are some things you could do, but most of them would require changing the provided classes. Sun have told us that those classes "are complete". I take that as meaning that we should not go changing existing functionality if we can avoid it.
Your comment is saying this invariant() method isn't much of a rigid check against muliple applications accessing the data file ?
Can you elaborate on the holes in this mechasim as to when it could fail to guard against multiple applications accessing the data file?
[Andrew]: Personally I think it would be very difficult to guarantee that only one application could access the database at any given time. There are some things you could do, but most of them would require changing the provided classes. Sun have told us that those classes "are complete". I take that as meaning that we should not go changing existing functionality if we can avoid it.
[Eugene]: I am very curious about what you could do as you mentioned above. Can you elaborate on that ?
The Sun Certified Java Developer Exam with J2SE 5: paper version from Amazon, PDF from Apress, Online reference: Books 24x7 Personal blog
New rule: no elephants at the chess tournament. Tiny ads are still okay.
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
|