jQuery in Action, 2nd edition*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes NX: Urlybird (Data and Locking) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "NX: Urlybird (Data and Locking)" Watch "NX: Urlybird (Data and Locking)" New topic
Author

NX: Urlybird (Data and Locking)

Phil Harron
Greenhorn

Joined: Jun 21, 2002
Posts: 29
Hi all,

I've recently joined up for my SCJD exam and have been reading the many various interesting posts.

I have a couple of questions - sorry if they have been answered before.

I've decided to use the many instances of the Data class, and hold a static list of recIds that are currently locked. (as in M Habbibi's book). In my exam i'm told that Data must implement DBMain

1) Does this mean that I can't create an adapter class, which implements DBmain, and then have a reference to Data from the Adapter? How else could I get round this? I suppose I could have a DataManager which deals with locking etc.. with a reference to Data and note in the documentation that any new developments should use the DataManager class.

2) If I synchronize the list of RecIds, in the lock and unlock methods why would I need the isLocked method ?

Thanks v much
Phil


SCJP 1.4<br />SCJD (Ongoing)
Philippe Maquet
Bartender

Joined: Jun 02, 2003
Posts: 1872
Hi Phil,

Does this mean that I can't create an adapter class, which implements DBmain, and then have a reference to Data from the Adapter? How else could I get round this?


Your adapter could not implement DBmain and own a reference to Data which implements it. Where is the issue?

If I synchronize the list of RecIds, in the lock and unlock methods why would I need the isLocked method ?


Do you have an isLocked() method in your interface? (in my version there is no isLocked()).

Regards,

Phil.
Phil Harron
Greenhorn

Joined: Jun 21, 2002
Posts: 29
Thanks Phil

Do you have an isLocked() method in your interface? (in my version there is no isLocked()).

Yes I have an isLocked() method in my interface. If I synchronize my static list in the lock() and unLock() methods then the JVM will know if its locked or not? I know I must implement the isLocked() method, but I dont want to do it for no good reason.

Your adapter could not implement DBmain and own a reference to Data which implements it. Where is the issue?


So, do you mean that Data could implement DBMain and my Adapter could implement DBMain as well?

Thanks again for your help

[ May 14, 2004: Message edited by: Phil Harron ]
[ May 14, 2004: Message edited by: Phil Harron ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: NX: Urlybird (Data and Locking)
 
Similar Threads
NX SCJD: but passed with 155/155
Data Server Design
Using the unreferenced interface
About stop the RMI server
RMI - Stub Generation - B & S