Dear All,
Finally i have comeup with my design and also implemented. Kindly please go through and give my ur valid feed back.
Server Design
-------------
* I have an Interface DataInterface which has all the public methods of Data class, Here all the methods throw RemoteException along with the other exception it throws.
* I have a RemoteDataInterface which just extend DataInterface,Remote interface.
* For LocalData access i have a class DataAccess which implements DataInterface and instantiate Data class.
* For performing locking and unlocking I have a class LockMgr which extends Data class and override lock() and unlock(), this class I implement singleton
pattern. Here i dont handle clientID.
* For RemoteData access I have a class named RemoteDataAccess which extends UnicastRemoteObject and implements RemoteDataInterface, Here i have a instance of LockMgr, which i use for all database releated operation including locking and unlocking.
* In case of criteriaFind i just modified the Data class
* Finally i have GUI class, which is used to start and stop the server. This also bind the rmi server with the registry.
Client Design
-------------
Iam following the MVC archicture
*FBNMainGUI is the views class which has all the GUI components related to viewing and quering.
*I have a class FBNController which handles all the events that are generated by the views class. Here my controller implements ActionListener.
*I have a facade class which acts as model, invoked by the FBNController calls the connectionFactory and get the appropriate data class.
Here in the above design when ever any request made through the FBNMainGUI, is recived by controller and processed by FBNFacade and Controller recive the result back and this again update the GUI.
Here inorder to decouple the view and controller i use hook methods concept which was adviced by MARK
i also follow commandpattern in even handling.
Thanks & regards,
-rameshkumar
-rameshkumar