aspose file tools*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Data.java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Data.java" Watch "Data.java" New topic
Author

Data.java

Ken Boyd
Ranch Hand

Joined: Dec 10, 2003
Posts: 329
I am sure question might have asked but need to clarify my assumption...

1. Data.java has to implement all locking thing because assignment has mention that clearly


Your server must be capable of handling multiple concurrent requests, and as part of this capability, must provide locking functionality as specified in the interface provided above.


So all Synchronized thing has to be implemented by Data.java.

I think someone got failed for not doing that.

Thanks
[ May 27, 2005: Message edited by: Ken Boyd ]

SCJP, SCWCD, SCBCD, SCJD, BB Java2 and JSP1.1
Andrew Monkhouse
author and jackaroo
Marshal Commander

Joined: Mar 28, 2003
Posts: 11285
    
  59

Hi Ken,

I am not sure what your question is.

If you are asking whether the locking code can exist in some other class than the Data class - I believe it can be, as long as the Data class acts as a front end to the locking methods (Facade pattern).

If you are asking whether methods that call the Data class' locking methods can be synchronised (or can contain synchronized blocks) - why not?

Or are you asking something else?

Regards, Andrew


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

Joined: Dec 10, 2003
Posts: 329
Hi Andrew,
My question is you have to provide locking mechanism in Data.java class (it is must according to above quote from assignment document) If you provide them in other class then SUN will fail you. So you have to provide all locking in Data.java and provide wrapper class to access all methods of Data.java

kind of answer myself but need validation from you.

Thanks,
Ken
Andrew Monkhouse
author and jackaroo
Marshal Commander

Joined: Mar 28, 2003
Posts: 11285
    
  59

Hi Ken,

Originally posted by Ken Boyd
So you have to provide all locking in Data.java


When you have completed your coding of the Data class then any user of the Data class (whether the server you write, or some other programs that somebody else writes) must be able to call the lock methods of your Data class and obtain a logical lock on the requested record (or block until the logical lock is available).

Originally posted by Ken Boyd
So you have to [...] provide wrapper class to access all methods of Data.java


Personally I agree with that statement. However there are many who disagree. You might like to take a look at the topic "Should lock methods be callable by the client" for arguments for and against this position. It is worth noting that candidates do not appear to loose marks for not having such wrapper classes.

Regards, Andrew
Ken Boyd
Ranch Hand

Joined: Dec 10, 2003
Posts: 329
I know Eric(65515) got fail because he didn't provide locking in Data.java (instead in wrapper class). So it is must to have locking in Data.java, so SUN can directly test it using other program or software.
I will provide wrapper class with different method name which in turn calls lock & unlock methods of Data.java.

Hope I am clear and right as well.

Thanks,
Ken
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Data.java
 
Similar Threads
What shall Data class really do?
forced to implement local locking
Passed 360/400
Implementing Lock/Unlock
Passed 360/400