This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Thank you all! thank you Andrew, you helped me a lot when I was in trouble with RMI; thank you Phil., I used the three layers thin client structure you advocated deadly , and thank you for bringing me a lot of happy time when reading the articles you write; thank you Mark, I used the right MVC mode you suggested, I uncoupled the view totally from controller(in fact I prefer the Mediator pattern MVC according to GOF, it is more clear but has too much customized classes), and set the Executor to execute the task, you give me a wonderful solution, thank you Jim, you resolved a lot of my confused questions. And thank you all who had helped me. My favorite choices: 1. Use nio because Mark said, 2. Use RMI because Andrew said, 3. Use three layers thin client because Phil said, 4. .... My choices includes following subtitles: 1. Overview 2. Clarity and maintenance 3. Data class 4. Server design 5. Client design 6. User interface 7. Exception 8. Lock and thread safety 9. Pattern summary In addition, I find that many recently passed candidates got only 44 in locking, there must be something lost in the solution of lock/unlock or the use of it. THis is my lock/unlock:
This is how I use it when I book a record, book method is at server side:
I don't use it when I find records in database.
Grade: P Score: 363 Comment: This report shows the total 1.4 SCJD points that could have been awarded in each section, and the actual number of points you were awarded. This is provided to give you per-section feedback on your strengths. The maximum possible score is 400; the minimum to pass is 320. General Considerations (maximum = 100): 100 Documentation (maximum = 70): 70 O-O Design (maximum = 30): 29 GUI (maximum = 40): 40 Locking (maximum = 80): 44 Data store (maximum = 40): 40 Network server (maximum = 40): 40
Sincerely, Damu [ January 26, 2004: Message edited by: damu liu ] [ January 26, 2004: Message edited by: Mark Spritzler ]
Nice shot, Damu ! Congratulations ! It would be interesting if Peter and Nicholas could give us some clues about their locking as you did above. Three 44/80 for locking on the same day, quite weird isn't it ? Damu, it's a high time I go and work, but tonight I'll check the locking code you posted above. And I hope Peter and Nicholas will post some of their locking details in the meantime. Best, Phil.
Max - Could the fact that some of us are NOT calling notifyAll in the lock be what is losing points? Is that what you mean here? TJ
SCJP, SCJD, SCWCD, SCBCD
town drunk ( and author)
Joined: Jun 27, 2002
I don't really have enough information to say anything yet. I'd just to know if the people who lost points are people also didn't call notifyAll in lock. If that's so, then we can come up with theories on why that might be so. M
Joined: Sep 27, 2003
I called notifyAll() in all of my object locking situations and still got counted off. Zak
town drunk ( and author)
Joined: Jun 27, 2002
Zak, Wolud you mind mailing the locking code to me directly? I'm interested in this. All best, M
Congrats Damu. Well done. I am going to remove your actual code, as we cannot post those kind of things here, which would give away too much of the coding for someone taking the assignment now and in the future. I am also going to move this thread to the more appropriate Certification Results forum. Thanks Mark
Hi Damu and Max, Damu, reading you lockRecord() / unlock() methods above, I cannot see anything wrong in them. IMO, the explanation must be somewhere else.
Max: I'd just to know if the people who lost points are people also didn't call notifyAll in lock. If that's so, then we can come up with theories on why that might be so.
Mmh... I'd like to discuss about the theories on why that might be so even if we cannot find such a correlation. My problem here is that each time I see some notifyAll() in lock(), I advice to remove it. And as I am commonly followed on this topic, it would be a shame (and I would be ashamed of ) in the case I am wrong. notifyAll() in unlock() means "Hey guys, I just released a lock you may be interested in. Please wake up and check your waiting condition". That use is obvious. notifyAll() in lock() would mean "Hey guys, I just got a lock on a record. By definition, I know that you aren't interested in that news, but it was so compelling to wake you up for nothing, that I couldn't resist.". Max, if I missed something, please tell me here. --- I wrote the above lines last night, and this morning the thread was moved and the code removed... I had a few ideas about why so many people loose points in locking, but this thread is not the right place anymore to discuss locking. Maybe later in a new SCJD thread ? Regards, Phil.