• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

NX:Question about RandomAccessFile

 
Ranch Hand
Posts: 222
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 4982
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Have you no shame? Have you no decency? Have you no tiny ad?
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic