aspose file tools*
The moose likes Certification Results and the fly likes NX: Passed B&S   387/400 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Certification Results
Bookmark "NX: Passed B&S   387/400" Watch "NX: Passed B&S   387/400" New topic
Author

NX: Passed B&S 387/400

Hugh Johns
Ranch Hand

Joined: Jul 28, 2003
Posts: 36
I got my results from the certmanager site.

Summary is:

Section Max Points Actual Points
General Con: 100 90
Documentation: 70 70
OOD: 30 30
GUI: 40 37
Locking: 80 80
Data Store: 40 40
Network Server: 40 40

Total: 400 387


I am quite happy with it, as I do not think my programming/design skills are all that hot. Thanks to all for your help, I have always found this forum very helpful.
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17259
    
    6

Great job Hugh. This thread will be moved to the more appropriate Certification Results forum.

So tell us about your locking, since many here keep getting 44/80. You received 80/80 so describe your architecture, what your did and didn't do.

Mark

p.s. My guess is you went simple.


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
Hugh Johns
Ranch Hand

Joined: Jul 28, 2003
Posts: 36
Basically just like Max does in his book, A static HashMap in the Data class is used to store record/lockcookie mappings for all clients. Each client holds the lockcookie while it has a lock on a record.
All other clients wait until the lock holding client gives up the lock. Unlocking removes the record/lockcookie mappings from the HashMap and notifies all waiting clients.

The only difference is I syncronize on the static Hashmap object for all
locking actions not using method sync, I also said I was assuming each client would only have one cookie at any one time (an iffy statement at best)

Thanks again
Philippe Maquet
Bartender

Joined: Jun 02, 2003
Posts: 1872
Hey Mark! It's always nice to see you back here!

Congratulations, Hugh!

Mark:This thread will be moved to the more appropriate Certification Results forum.


But not immediately, because we now apply the rule slightly differently (we just try this): in this case, as I was the first to see it, I'll be the one who will copy it to the Cert Results forum and close it here. But I'll wait till Andrew sees it also, plus one day. So in practice, such a thread stays open here during two days on average (if a sheriff doesn't close it in the meantime, of course ).

Now if such a thread leads to an interesting design discussion, it may never close. Especially if it helps us find out where the weird 44/80 score for locking is coming from!

p.s. My guess is you went simple.


Mmh... OK, Mark. If Hugh's locking design is that simple, we won't close this one, promised!

Come on, Hugh!

Best regards,

Phil.
[ May 31, 2004: Message edited by: Philippe Maquet ]
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17259
    
    6

Hey Mark! It's always nice to see you back here!


I never left, I just respond to a one or two at a time. Not much time these days.

Mark
Andrew Monkhouse
author and jackaroo
Marshal Commander

Joined: Mar 28, 2003
Posts: 11509
    
  95

Congratulations Hugh


The Sun Certified Java Developer Exam with J2SE 5: paper version from Amazon, PDF from Apress, Online reference: Books 24x7 Personal blog
Hugh Johns
Ranch Hand

Joined: Jul 28, 2003
Posts: 36
In the off chance it might help someone -

All records are cached as record objects (a custom class)

Lock mappings are stored in the Data attribute (all synchro is done on this oject for locking actions)
private static HashMap recordsLocked = new HashMap();

As above in the Data class I implement the Sun supplied,

public long lockRecord(long recNo)throws RecordNotFoundException
(if mapping already exists for this record wait until lock released, otherwise add new record/random lockcookie mapping to HashMap recordsLocked )

public void unlock(long recNo, long cookie)throws SecurityException
( check using Data method isValidRecordLock(recNo, cookie) if a record lock exists for this record/lockcookie combination, if so remove mapping from hashmap. )

These methods are wrapped in the Remote implementation, in the local implementation the methods throw new UnsupportedOperationException ("No local locking implemented");

Each clients controller class has a connetion object (local or remote Database access implementation ) and stores one lockcookie


The client only uses locking when a RMI client books a record, for a local
connetion -1 passed as lockcookie indicates ignore lcoking.



Hope it helps.

ps. I found the most confusing aspect of the project was exception handling, I just passed everything up to the GUI controller, which rewrapped the message and sent it to a GUI level error display method
to generate a dialog window with the original cause string.
I could not see any case where I would handle an exception at a lower level.
Still not sure if this is right.

Regards

Hugh
Vishwa Kumba
Ranch Hand

Joined: Aug 27, 2003
Posts: 1066
Congratulations Hugh!
I like the idea of ignoring locking in the local mode.
Guvenc Gulce
Greenhorn

Joined: May 19, 2004
Posts: 6
Congrutalations Hugh,
Great Score.. !
I was just curious about the create()/delete() methods
of data class.. did you implement them, although your
clients dont use them ? or did you just throw
"Unsupportedexception" like some other guys did..

Regards

Guvenc Gulce
S Perreault
Ranch Hand

Joined: Oct 29, 2003
Posts: 37
Congrats Hugh, excellent score!

I was wondering if you synchronized any of your methods or only some interior parts of the methods. I am having a difficult time figuring out where I should be synchronizing.

Thanks
Perogi.
Hugh Johns
Ranch Hand

Joined: Jul 28, 2003
Posts: 36
Guvenc

I did implement fully all the Sun supplied DBAccess methods, I thought it was good practice. Just did not use them in the GUI controller, but they can be easilly used by anyone extending the code in the future,

Perogi

I only used object block synchronizing, as I found it easier to get my head around the idea of locking up a particular object while a change is being made.

Regards

Hugh
S Perreault
Ranch Hand

Joined: Oct 29, 2003
Posts: 37
Hugh,

Thank you for your quick response. I will go through my methods and ensure that the critical sections are protected.

Perogi.
Andrew Monkhouse
author and jackaroo
Marshal Commander

Joined: Mar 28, 2003
Posts: 11509
    
  95

Moved to Sun Certification Results forum.
George Marinkovich
Ranch Hand

Joined: Apr 15, 2003
Posts: 619
Hi Hugh,

Congratulations on the excellent score

...and on the perfect locking score

Best wishes in all your future endeavors.


Regards, George
SCJP, SCJD, SCWCD, SCBCD
 
jQuery in Action, 2nd edition
 
subject: NX: Passed B&S 387/400