Dear, all-members ! My package structure is as follows; suncertify : 1. db ; Data.java, DataInfo.java, FieldInfo.java, DatabaseException.java, db.db 2. server ; DataServer.java(Interface), Server.java, ServerImpl.java 3. client ; DataClient.java(Interface), DataClientGUI.java, LocalDataClient.java, RemoteClient.java TableModel.java To get a remote & local instance at GUI, I intend to use following code snippet. ======================================== Data data; if (local) data = new LocalDataClient(); else data = (ServerImpl) Name.lookup(bla bla) ======================================== Can anyone suggest a graceful way to implement it ? Thanks in advance.
It looks like it is a good implementation. If I had a suggestion to what you might be asking, I'd say put that code into a DataAccessFactory class, that the client main class calls with the necessay parameters. Mark
Mark, In the following code snippet. ======================================== Data data; if (local) data = new LocalDataClient(); else data = (ServerImpl) Name.lookup(bla bla) ======================================== Does the rmi server not have to be up and running for the else to work ? In other words what happens in the following secnario :- The above client is in local mode and gets the local data connection. Some other remote client can also connect because the server is up and running. So would we not have two diffent connections to the database with their own Data objects and hence locking mechanism etc.. Please correct me if i am completely off beat here. I did search the forum for this ,but still i am not very clear on this topic. Thanks in advance. Regards Suchak Jani