This week's book giveaway is in the Other Languages forum.
We're giving away four copies of Functional Reactive Programming and have Stephen Blackheath and Anthony Jones on-line!
See this thread for details.
Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

NX:Question about RandomAccessFile

 
HaoZhe Xu
Ranch Hand
Posts: 222
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Nicholas Cheung
Ranch Hand
Posts: 4982
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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.
 
HaoZhe Xu
Ranch Hand
Posts: 222
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic