This week's book giveaway is in the OCAJP forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide 1Z0-808 and have Jeanne Boyarsky & Scott Selikoff on-line! See this thread for details.
i follow Mike and most people's design idea,but have some questins please give you hand **DataInterface -define all the public methods in data **Data -Implements DataInterface also have criteriaFind and lock/unlock methods. **RemoteDataInterface -extends Remote and DI. It is the interface for rmi calls. **DataAccessLocal -Implements DI, **DataAccessRemote -Implements RemoteDataInterface i have a DataFaceory class in client ,which return a database connection depending on the arguments. in DataAccessLocal i use Adapter pattern as
i am not sure the DataAccessRemote for i want to the same pattern in DataAccessRemote. as follows
and in the server class i use
Am i right as for the DataAccessRemote ,thank you for your help?
Well in your DataAccessRemote, your constructor accepts a DataInterface, but you are passing it a Data reference in the server. Did you change your Data class to implement DataInterface? if so, you are ok with that code, otherwise you need to change the constructor of the DataAccessRemote to accept a Data class and not a DataInterface.
Then you are binding the remote class to the registry. I think you will find out later that you do not want to do this for client id reasons. Try doing a search on ConnectionFactory in this forum, you will find some very interesting reading there. Good Luck, and we are all here to help you, so don't be shy. Mark