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.
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
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.
Joined: Jan 31, 2002
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 ?
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
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.