views:

34

answers:

2

Suppose that I am implementing a remote proxy in Java to an object that is likely to reside on a remote server but may reside locally.

There's my real object on the remote server, there's the local implementation (the proxy itself), and there's the interface I provide to my program which hides the details of where the object actually is. The local representation may contact a local or a remote implementation of the object.

What is the standard terminology in Java for these things? What should I name my interfaces/classes?

I've seen the terms Subjects, Images, and Implementations thrown around (probably from the GOF days), but I wonder what is acceptable way to do the naming for a framework written in Java.

A: 

You may want to use the same terminology that RMI uses, even if you've decided not to actually use RMI. eg: stubs, skeletons, registries, servers...

Laurence Gonsalves
Most of these artifacts may not actually exist or have any equal in other protocols that may actually be used.
Robin
A: 

Since remoting usually entails some kind of service like call, I usually go with service interface, remote proxy and service implementation. Since the implementation is determined at runtime (proxy or implementation), all coding is done to the service interface as it is the only public API.

Spring Remoting makes this very easy, we use it extensively to provide remote proxies over HTTP, EJB and JMS to the same services. Also makes testing without any proxy trivial as well. We can run the same tests for unit tests directly against the implementation, as well as integration tests against a server.

Robin