Hi All,
I have nearly completed my assignment, but was stuck with this issue.
RMI give no assurance about
thread and the server has to be made thread safe. Now what is the criteria for thread-safe?.
I could,
1. Use one data class and let the threads use the individual methods of the data class. There are no modifyable instance variables within the method. The client directly calls the Data methods through paramaters. The data classes access the physical file through a singleton filehandler instance.
2. Use separate data classes for each data "Call". I am doing this right now, but I feel its a over kill creating so many classes.
3. Create one data class per client. I will have to redesign my intefaces and I prefer this the least.
My lockManager is a singleton and works whether there is multiple or single data class instances. I myself put a stone in my foot by using a MDI client, which can have multiple search windows within it. But theoritically it should not create problems.
I read in Andrew's book that he prefers separate data classes to prevent thread safety issues, but what are the issues?. I prefer point (1), but are there any pitfalls in that approach, am I missing something?.
Thanks.