aspose file tools*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes about the stub Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "about the stub" Watch "about the stub" New topic
Author

about the stub

Ray Cheeny
Ranch Hand

Joined: Aug 21, 2002
Posts: 74
Hi,
please look the code:

1>Will all the clients have the same 'a' ?
2>Will all the clients have the same 'b' ?
Michael Morris
Ranch Hand

Joined: Jan 30, 2002
Posts: 3451
Hi Ray,

1>Will all the clients have the same 'a' ?

Yes. They will receive a different stub into the same object.


2>Will all the clients have the same 'b' ?

Question is how will they ever get a reference to b? Your code doesn't show any way to access b unless class A holds a reference to it.
Hope this helps,
Michael Morris


Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius - and a lot of courage - to move in the opposite direction. - Ernst F. Schumacher
Ray Cheeny
Ranch Hand

Joined: Aug 21, 2002
Posts: 74
hi,
I use the FactoryConnection class which has a mehtod named getConnection or something similar which returns an implementation of my remote Data interface(like return new RemoteAccess()).
Could I get a unique object of the RemoteAccess?
Is the getConnection of mine right?If not,please tell me how to do it.
Michael Morris
Ranch Hand

Joined: Jan 30, 2002
Posts: 3451
Hi Ray,
So long as your getConnection returns a new object (remote implementation) on every call then each client will have a unique connection.

Hope this helps,
Michael Morris
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: about the stub