posted 22 years ago
Data class
DataAccess interface implements all the methods of the Data class.
DataAccessLocal implements DataAccess
DataAccessRemote implements DataAccess
DataAccessFacade takes a DataAccess class in it's constructor.
DataAccessFactory takes the arg[] string array from the client's main, determines if it should be local or remote. If remote it does an RMI lookup calls getConnection which returns a DataAccessRemote class. If it is local it creates an instance of the Data Class wraps it into the DataAccessLocal
. In both cases I pass the returned DataAccess class to the constructor of the DataAccessFacade. The factory then returns a DataAccessFacade to the client. Now the client has no idea whether it is in local or remote mode, nor does it ever need to know. I can change my DataAccess interface, Data class, DB and server with out the client ever knowing.
How that relates to what you are asking, I am not sure, as I am not sure what the DataClient class does. Is it in the Data package or the Client package?
Hope that helps
Mark