posted 20 years ago
Hi Peter,
Think about having an Adapter/Wrapper class that calls the methods in the
Data class. The adapter class should also implement an interface.
This adapter class can be used both in local and remote mode. How do you use the class in remote mode? Well then create a class for remote mode that implements the adapter class interface and is also given a handle to
the non remote adapter upon creation. Now the remote class has to implement all of the methods in the interface, but the body of each method is simply a call to the non remote class.
Ex. In this example DBAdapter is the interface that Adapters implements.
The following is what some of the methods would look like in the remote
Adapter
Remember though you have to make sure the adapter interface, DBAdapter, is remote capable for the remote adapter. To do this you must declare the
interface as throwing an IOException for every method.
This is just one design I have seen many times.