File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes NX:Question about RandomAccessFile Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "NX:Question about RandomAccessFile" Watch "NX:Question about RandomAccessFile" New topic
Author

NX:Question about RandomAccessFile

HaoZhe Xu
Ranch Hand

Joined: Nov 03, 2003
Posts: 222
I am doing the UrlyBird project, the server give each client a new Data instance, so should the Data implements Serializable?( it already implements DBMain, is it allow to implement more than one DBMain interface?) And, inside the Data class, there's a RandomAccessFile object, it doesn't implement Seriliazable, so what should I do?
Thanks.


[url]Olnex.net[/url]
[SCJP 1.2, SCJD, SCWCD]
Nicholas Cheung
Ranch Hand

Joined: Nov 07, 2003
Posts: 4982

Should the Data implements Serializable?

I dont think Data need to implements Serializable unless you will send this object / instance through the network.

it already implements DBMain, is it allow to implement more than one DBMain interface?

Yes becos the instruction does not mention anything about multiple inheritance.

inside the Data class, there's a RandomAccessFile object, it doesn't implement Seriliazable, so what should I do?

Why you need to do so?
An object that requires to implement Serializable ONLY IF it will be sent through the network. Will you need to send a RAF object via RMI?
Hope this help.
Nick.


SCJP 1.2, OCP 9i DBA, SCWCD 1.3, SCJP 1.4 (SAI), SCJD 1.4, SCWCD 1.4 (Beta), ICED (IBM 287, IBM 484, IBM 486), SCMAD 1.0 (Beta), SCBCD 1.3, ICSD (IBM 288), ICDBA (IBM 700, IBM 701), SCDJWS, ICSD (IBM 348), OCP 10g DBA (Beta), SCJP 5.0 (Beta), SCJA 1.0 (Beta), MCP(70-270), SCBCD 5.0 (Beta), SCJP 6.0, SCEA for JEE5 (in progress)
HaoZhe Xu
Ranch Hand

Joined: Nov 03, 2003
Posts: 222
I think I should rewrite my question again (forgive my English):
Each client has an own RAF object to access remote database, many people use factory pattern, the server register only one factory, and each client get a database connection using the factory referrence, what's that connection? Is it a new Data object or a wrapped class? I am confused?
 
 
subject: NX:Question about RandomAccessFile