jQuery in Action, 2nd edition*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes B&S & Denny's: Design decisions (locking stuff really) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "B&S & Denny Watch "B&S & Denny New topic
Author

B&S & Denny's: Design decisions (locking stuff really)

Mickey Mulligan
Greenhorn

Joined: Feb 26, 2006
Posts: 20
Hey,
I've seen how logical locking was implemented in Denny's DVD's, the project that came with the SCJD book. I'm looking to do something similar for my assignment (Bodgitt & Scarper), so I'll have a "LockingManager" class to handle locking and unlocking records. At the moment I've got (pseudocode):



I presume using a synchronized block to sort out the problem with threads slicing in is a good idea? Are there any other designs I should look at perhaps? I like the idea of keeping the locking seperate from File I/O so I want to keep it that way. But not if I'm going to lose marks for overuse of 'synchronized'!
 
Consider Paul's rocket mass heater.
 
subject: B&S & Denny's: Design decisions (locking stuff really)
 
Similar Threads
B&S, Q: good synchronization?
B&S: must i pass ref to fileHandler to lockHandler?
Should synchronized methods call other synchronized methods?
facade design pattern question
URLyBird: Checking for a deleted record in a Lock Manager