wood burning stoves*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes The Data Client / Connection Proxy Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "The Data Client / Connection Proxy" Watch "The Data Client / Connection Proxy" New topic
Author

The Data Client / Connection Proxy

dean tomlinson
Ranch Hand

Joined: Jan 31, 2002
Posts: 94
I have been following the ConnectionFactory topic, but have a question.
The clients connection object (as detailed by that mark and peter) implements the Data interface, but essentially lives on the server. does the connection objects stub count as the clients data client, with respect to the following requirement...
"To connect with your server, you should create a client program. This implementation should include a class that implements the same public methods".
Or do you think I need something like a RemoteDataClient that also implements the Data interface and wraps the stub to the server side Connection?
Your opinions are greatly appreciated. Thanks Dean
Sai Prasad
Ranch Hand

Joined: Feb 25, 2002
Posts: 560
I have implemented a client side factory to create local Data object or get remote Data object and then assign this Data object to a proxy object. In my design Client always communicate with the Data proxy object and not the xxx_stub. The Data proxy object uses the xxx_stub object for remote operation.
dean tomlinson
Ranch Hand

Joined: Jan 31, 2002
Posts: 94
Hi Sai, Thanks for your reply.
Am I right to summarise what you are saying as...
You have an object called say RemoteDataProxy (not an rmi.remote object) that implements the data interface (as per the requirements). Held within the RemoteDataProxy object is the stub to the clients individual Connection object.
Most of the database calls are delegated through to the Connection object on the server, which will handle locking and unlocking etc ?
Is that right ?
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17257
    
    6

does the connection objects stub count as the clients data client, with respect to the following requirement...

Yes, but Sai is also more right, in that he wraps it in another class or Proxy. that way the client is only dealing with the Proxy, and knows absolutely nothing about what's behind it, local or remote.
In my design that class was a Facade, but really still the same thing.
Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
dean tomlinson
Ranch Hand

Joined: Jan 31, 2002
Posts: 94
hi mark,
Yes, but Sai is also more right, in that he wraps it in another class or Proxy. that way the client is only dealing with the Proxy, and knows absolutely nothing about what's behind it, local or remote.

what i was intending was to call a DataAccessFactroy that returns an implementation of the DataAccess interface. My facade controller oject only talks to the DataAccess interface.
Depending on the parameter value sent to the factroy, the implementation of the DataAccess interface returned will be either a Data object for local mode, or either the stub to the Remote Connection object (which is a remote proxy), or a Class that wraps the stub, and delegates to the stub ?
With a bit more background to my question. Does the stub to the Connection which implements the DataAccess interface, count as ...
"To connect with your server, you should create a client program. This implmentation should include a class that implements the same public methods as the Data class"
thanks a lot - I understand generally what i'm going to do but am wary about violating any of the requirments.
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17257
    
    6

Dean - Yes it would count as that.
Mark
dean tomlinson
Ranch Hand

Joined: Jan 31, 2002
Posts: 94
thanks again mark ! have a good weekend
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: The Data Client / Connection Proxy