I provided a design in your "Local Adapter Issue"
thread.
Using that design here's how it works:
------ Stand alone mode (arg=alone) ------------
- BookingModel has a DBAccess instance that is a Data object
- Data has a DatabaseFile singleton that does the I/O
no networking is involved
------ Networked client mode (arg="") ----------
- BookingModel has a DBAccess instance that is a DataProxy object
- DataProxy has a DataAdapter instance that is a remote DataAdapterImpl object
- DataAdapterImpl has a DBAccess instance that is a Data object
- Data has a DatabaseFile singleto that does the I/O
RMI networking is used between the DataProxy and the DataAdapterImpl. The DataProxy used a DataAdapterFactory to get the DataAdapter. DataAdapterFactoryImpl was registered in the RMI registry.
A simple factory method
pattern is used to build either a Data or DataProxy depending on the startup parameter. Since both Data and DataProxy implement DBAccess this is possible.