This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Data Object creation in Remote Mode! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Data Object creation in Remote Mode!" Watch "Data Object creation in Remote Mode!" New topic

Data Object creation in Remote Mode!

Vikas Sood
Ranch Hand

Joined: Sep 03, 2002
Posts: 109
Hi Mark,
I am using a connection factory to create an instance per client of RemoteData for remote access.
I am using creating an instance of Data like this:
private static Data data=new Data("db.db");
What i understand from my experience that this way i have created a globally available instance of Data,which is assigned a new instance of Data class the first time the RemoteData class is loaded on to the jvm.Am i right? I am a bit confused ! If what i am sugessting is right then i am going to have just one instance of Data for all my RemoteData instances.
Kindly comment.
Mark Spritzler

Joined: Feb 05, 2001
Posts: 17271

That is basically correct, you pass the reference to that Data instance to the DataAccessRemote class that gets created and passed to the client. And yse that way there is one and only one Data class instance and each client ahs their own DataAccessRemote class.

Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
Have you checked out Aspose?
subject: Data Object creation in Remote Mode!
It's not a secret anymore!