This week's giveaway is in the Programmer Certification (OCPJP) forum.
We're giving away four copies of Java Mock Exams (software) and have David Mayer on-line!
See this thread for details.
Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

share one instance of remote object

 
Yan Zhou
Ranch Hand
Posts: 137
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there,

Suppose I have class Data implements DBMain as the test requires, then my network server registers an instance of Data.

It seems that all clients will share that single instance of Data. I wonder if there is a way allowing each client to have one instance of Data?

The only way I can think of is to register a DataFactory object and have each client to call its createData() method and get back a Data instance. I do not think it is necessary or even appropriate for JDCert exam.

But I am just wondering if anyone would suggest this approach, i.e., each client has its own Data interface and provide synchronization on its static members.

Thanks.
Yan
 
Jared Chapman
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Check out these threads. I used them when pondering the same question:
Habibi book: How many instances of remote object and Data object exist ?
Topic: Multiple instances of Data.
Topic: Single or multiple instances of Data class
Topic: NX: What is the point of multiple instances?
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!